2016-10-19 04:40:52 +00:00
|
|
|
class Users::SessionsController < Devise::SessionsController
|
2016-10-22 08:46:39 +00:00
|
|
|
protected
|
|
|
|
|
|
|
|
def after_sign_in_path_for(resource)
|
|
|
|
stored = stored_location_for(User)
|
|
|
|
return stored if stored
|
|
|
|
|
|
|
|
if request.referer&.match(sign_in_url) || request.referer&.match(sign_up_url)
|
|
|
|
super
|
|
|
|
else
|
|
|
|
request.referer || root_path
|
|
|
|
end
|
|
|
|
end
|
2016-10-19 04:40:52 +00:00
|
|
|
end
|