Class: RailsJwtAuth::PasswordsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- RailsJwtAuth::PasswordsController
- Defined in:
- app/controllers/rails_jwt_auth/passwords_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
2 3 4 5 6 |
# File 'app/controllers/rails_jwt_auth/passwords_controller.rb', line 2 def create user = RailsJwtAuth.model.find_by!(email: create_password_params[:email]) user.send_reset_password_instructions render json: {}, status: 204 end |
#update ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'app/controllers/rails_jwt_auth/passwords_controller.rb', line 8 def update user = RailsJwtAuth.model.find_by!(reset_password_token: params[:reset_password_token]) if user.update_attributes(update_password_params) render json: {}, status: 204 else render json: update_error_response(user), status: 422 end end |