Sha256: f1b87c166ca1539019cf86e7c51dce6b4150256e14fd0256a164f8d975886045

Contents?: true

Size: 565 Bytes

Versions: 3

Compression:

Stored size: 565 Bytes

Contents

class Auth::NewPasswordController < ApplicationController
  include RedirectIfAuthenticated

  skip_authenticate

  def new
    render inertia: 'Auth/ResetPassword', props: {
      token: params[:token]
    }
  end

  def create
    form = Auth::NewPasswordForm.new params.permit(:token, :password, :password_confirmation)

    return redirect_to login_path, flash: { status: 'Your password has been reset.' } if form.reset?

    redirect_back_or_to password_reset_path(token: form.token),
                        inertia: { errors: form.error_messages }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
kaze-0.8.0 stubs/inertia-common/app/controllers/auth/new_password_controller.rb
kaze-0.7.0 stubs/inertia-common/app/controllers/auth/new_password_controller.rb
kaze-0.6.0 stubs/inertia-common/app/controllers/auth/new_password_controller.rb