Skips the welcome screen when the user is verifying via email
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user