0

I want to conver my existing site to angularJS application. Its flow is like this. My parent web site is having link to sign up or login page. As per user selection signup or login page should open.So once user login or created account he pointed to dashboard page.So how to do this angularJS? Please note my parent web site is not in angular.

Thanks in advnce.

3
  • possible duplicate of How to handle authentication in Angular JS application Commented May 27, 2014 at 7:00
  • Thanks Sam. But in my application , i want to create login page and signup page both. Commented May 27, 2014 at 7:07
  • The signup page is a simple HTML form page. Same as the login page. The server needs to save the session data after login. Commented May 27, 2014 at 7:49

1 Answer 1

0

Here is a suggested design and here is a little project I wrote that has Angular code authenticating with a PHP server. The code has both the Register and Log in options you are looking for.

  1. Use token based authentication (Im assuming your angular requests are JSON)

  2. After the user logs in or registers, send a bearer token back to Angular via the URL. On the server side set an expiry date for the token

  3. Every http request you make can include the token in the http header

The sample code has this implemented.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.