Class: RailsJwtAuth::ConfirmationsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- RailsJwtAuth::ConfirmationsController
show all
- Includes:
- RenderHelper
- Defined in:
- app/controllers/rails_jwt_auth/confirmations_controller.rb
Instance Method Summary
collapse
#render_201, #render_204, #render_422
Instance Method Details
#create ⇒ Object
5
6
7
8
9
10
|
# File 'app/controllers/rails_jwt_auth/confirmations_controller.rb', line 5
def create
user = RailsJwtAuth.model.where(email: confirmation_params[:email]).first
return render_422(email: [I18n.t('rails_jwt_auth.errors.not_found')]) unless user
user.send_confirmation_instructions ? render_204 : render_422(user.errors)
end
|
#update ⇒ Object
12
13
14
15
16
17
|
# File 'app/controllers/rails_jwt_auth/confirmations_controller.rb', line 12
def update
user = RailsJwtAuth.model.where(confirmation_token: params[:confirmation_token]).first
return render_422(confirmation_token: [I18n.t('rails_jwt_auth.errors.not_found')]) unless user
user.confirm! ? render_204 : render_422(user.errors)
end
|