So I've got a Rail application that is being served up a via Apache/SQL. The main website sits are www.railswebsite.com but also serves up flat data as JSON through its API. Now I want to set up an Angular app that lives on the same domain at www.railswebsite.com/angular/
My question is, would it be possible to just send the user to the rails app login page to set the cookie, redirect them to the angular app, and then just read the cookie within the Angular app to authenticate?
If so, is there an easy method for checking if a logged in state is set via the cookie and then using the ID to call the JSON file from the rails API I have set up?
I'm very green to Angular so I'm not really sure what the best approach would be or if something like this would even be possible. I figured using the already set cookie from the rails app would makes things a lot easier since I'm on the same domain already. Thanks