Class: RailsJwtAuth::InvitationsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- RailsJwtAuth::InvitationsController
- Includes:
- ParamsHelper, RenderHelper
- Defined in:
- app/controllers/rails_jwt_auth/invitations_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
used to invite a user, if user is invited send new invitation.
-
#show ⇒ Object
used to verify token.
-
#update ⇒ Object
used to accept invitation.
Methods included from RenderHelper
#render_204, #render_404, #render_410, #render_422, #render_profile, #render_registration, #render_session
Instance Method Details
#create ⇒ Object
used to invite a user, if user is invited send new invitation
17 18 19 20 |
# File 'app/controllers/rails_jwt_auth/invitations_controller.rb', line 17 def create user = RailsJwtAuth.model.invite(invitation_create_params) user.errors.empty? ? render_204 : render_422(user.errors.details) end |
#show ⇒ Object
used to verify token
10 11 12 13 14 |
# File 'app/controllers/rails_jwt_auth/invitations_controller.rb', line 10 def show return render_404 unless @user @user.expired_invitation_token? ? render_410 : render_204 end |
#update ⇒ Object
used to accept invitation
23 24 25 26 27 28 29 30 31 |
# File 'app/controllers/rails_jwt_auth/invitations_controller.rb', line 23 def update return render_404 unless @user if @user.accept_invitation(invitation_update_params) render_204 else render_422(@user.errors.details) end end |