1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/app/controllers/users/sessions_controller.rb

40 lines
793 B
Ruby
Raw Normal View History

2018-11-29 16:28:20 -05:00
# frozen_string_literal: true
class Users::SessionsController < Devise::SessionsController
2018-11-30 06:23:40 -05:00
skip_after_action :verify_authorized
skip_after_action :verify_policy_scoped
2018-12-13 21:13:49 -05:00
prepend_before_action :check_captcha, only: :create
2018-11-29 16:28:20 -05:00
# before_action :configure_sign_in_params, only: [:create]
# GET /resource/sign_in
# def new
# super
# end
# POST /resource/sign_in
2018-12-13 21:13:49 -05:00
def create
super
end
2018-11-29 16:28:20 -05:00
# DELETE /resource/sign_out
2018-12-13 21:13:49 -05:00
def destroy
super
end
2018-11-29 16:28:20 -05:00
2018-12-13 21:13:49 -05:00
protected
2018-11-29 16:28:20 -05:00
# If you have extra params to permit, append them to the sanitizer.
# def configure_sign_in_params
# devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])
# end
2018-12-13 21:13:49 -05:00
def check_captcha
return if verify_recaptcha
self.resource = resource_class.new sign_in_params
render :new
end
2018-11-29 16:28:20 -05:00
end