Search code examples
authenticationangularsocial-networkingforumangular2-routing

angular 2 Routing after Login


I've a best-practice question about login and routing (related to angular2)

I have a landing page with a login and I have a forum-platform which should be logged in to. The forum platform is a medium-sized university project we are building, where users can exchange questions about lecture topics, a smaller lighter version of StackOverflow-like forum if you will.

I'm fairly new to angular 2 but so far there are two possibilities which I hope you can give me some opinion on.

  1. Create 2 separate entities (landing page and platform) and then if the login is successful, it will send the user to the platform (so page will reload)
  2. Create 1 single page app and upon successful login route the user internally to plattform (no reloading).

Solution

    1. Easy, time saving, less security issues.

    2. Handling logins without reloading page comes with lot of JS code need to be implemented and you need to take care of security issues. Plus point is it looks good :)