Tuesday 15 March 2016

Need help with authentication and redirecting.

HiThis must be a bit of a long-shot but I need someone to help me figure out authentication in my webappHere is what I want: User opens site , if user is authenticated show him stuff based on his preferences else show a general page. Like RedditThe user wanders the website. Now if a user wants to upvote something , I want them to login.First I check in POST if user is autenticated then regisster upvote and send a JSON {status:done}, else I send {status:notloggedin} and on the front I pop up a modal with the Sign in form. Now when he logs-in it redirects to the initial redirects and I have noway of knowing where they came from ie I cant take them back to that page.Here is the code : http://ift.tt/1pJ9DEz

Submitted March 15, 2016 at 04:03PM by abkibaarnsit

No comments:

Post a Comment