I'm making a web app: Angular in front-end and Rails in back-end. When User signs up, I redirect them to Angular html routes using below function:
def after_inactive_sign_up_path_for(resource)
'/info-page'
end
In application controller, I render below function to check which template to render. If user is not logged in, I render home.html.erb. If user is logged in, I render Angular templates:
def home
if current_user
render :file => 'public/front-end/public/index.html', :layout => false and return
else
render :file => '/static_pages/home.html.erb'
end
end
And I set `Application#home' as root page in Rails like following way:
root 'application#home'
The problem occurs after the user signs up at the very first time of using my web app. I send out email confirmation email after user signs up so when they are redirected to /info-page, they are not successfully logged in yet so in Application#home, it falls under else statement and renders '/static_pages/home.html.erb'. If I want to successfully load /info-page, I need to render the other file because that file loads Angular.
So here is a question. After user signs up, current_user is nil. Is there any way to check any information related to user after they sign up?