How can I get devise to go to use one page as root if the user is logging in but another when they are logging out? - ruby-on-rails-3

I'm working on a Rails 3 application that uses devise for user authentication. I would like the user to only see the splash/signup page when they first visit the site but be sent to the login page if they log out or time out, as follows:
Splash page
Click on login link
Login page
Supply proper login credentials
User's dashboard
Click on logout link or user times out
Login page (not splash page)

Take a look in the devise wiki: How To: Change the redirect path after destroying a session i.e. signing out

Related

How to restore all the page information after logout using cookies on Selenium

After we click logout, the session expired and we can no longer use the store cookies to login the same user right? We are facing a situation where the same user would login to a system several times during the entire test suite, and we want to be able to restore all the page information that the user was on for various test case.
For example, User A login and navigate to page (Page-10) and then logout. After some time, User A login and navigate to page (Page-14) and then logout. Then, we want to be able to have the User A login and restore all the page information and direct the page to Page-10 without going over all the navigation process.
Or just login to an user and have all the iframes I open on the previous login. Anyone has any idea on how to do that?

Bypass user login (VB.Net)

I have this application (Windows Form App) that require user to enter their Username and Password. Inside this application, there are shortcut for website and each of the website also require user to login first before they can use the website. But I want to bypass user when they click the shortcut for the website (if they already login for the application) where the login page will skipped and redirect user to the mainpage of the website. User will only required to login if they are accessing the website without using the application.
I used Process.Start() to run the website when the website shortcut is clicked. It open the website but redirect user to the login page. How do I bypass user credentials so that they will be able to login once (through the application) and can access all the website without do login again?
Edit : Is it possible if I use session inside my website login coding to redirect user to the main page? So it's like, when user login using the application, the website will automatically detect that the user already login, so user will be redirected to the main page of the website without going through the login page.
Give your user an API key that is stored in the user database table that is unique that changes when they login. Then in VB use Process.Start("https://example.com/login.php?api_key=" + 'add api_key retrieved from database on login) then in your PHP you check for the api_key as a login that will create the session for the logged in user.

expressJS rendering login bootstrap modal if action is not authenticated

I am writing an expressjs/ejs app which is using Twitter Bootstrap 3 for web pages. I have used Bootstrap Modal for login. I have included the modal in the header section so it is available for every webpage. However, if a user has not logged in, he needs to be authenticated before performing certain actions on the app. I am using a middleware function to determine whether a user is logged in, however if a user is not logged in, I need to redirect him to home page and initiate the login model directly. I am not sure how I can initiate the bootstrap modal from server side. Any thoughts?
I need to be able to do:
response.render('/home#loginModal');
That way user is directed to home page and is given a chance to login.

how do i sign user out of my app?

I implementet Google+ Sign-In API in the root page of my app. It automatically signs in user if user is signed in to google, then API automatically signs him in to my app. The problem is that when user logs out of my app, he is redirected to root page which logs him back in, since he still is logged in to google.
You can see the whole code here: https://developers.google.com/+/web/signin/
wierd, they have "See also, signing the user out of your app."
link, but it's broken :(
Any ideas?
This is similar to this question:
Preventing automatic sign-in when using Google+ Sign-In
You could use a cookie that is set when the user is logged in on your site. If the user is logged in, indicated by the presence of the cookie, allow the user to automatically get redirected into your site. If the user is not logged in, require that the user click the sign-in button before you hide the button and redirect them to the signed-in experience. To log the user out, delete the cookie.

How to create popup window to login with linkedin in rails 3?

I have been facing this problem that i try to login to my website using linkedin, I am unable to do the following and don't know where to start eve,
when the user clicks on "log in via linkedin",
the user should get a linkedin login page(popup)
2.Once the user enters his login credentials and clicks to login the linkedin login page must be closed and my web page must shown to the user with the values if the login credentils are correct.
Please advise me how to go about.
How do i create popup upon clicking via linkedinlogin?
Thanks, Antony