Skips the welcome screen when the user is verifying via email

This commit is contained in:
kikito
2015-10-02 18:36:40 +02:00
parent fa19490991
commit 5069f86eb9

View File

@@ -1,11 +1,18 @@
class Users::SessionsController < Devise::SessionsController
def after_sign_in_path_for(resource)
if resource.show_welcome_screen?
if stored_path_allows_welcome_screen? && resource.show_welcome_screen?
welcome_path
else
root_path
end
end
private
def stored_path_allows_welcome_screen?
stored_path = session[stored_location_key_for(resource)]
stored_path[0..5] != "/email"
end
end