user2066880
user2066880

Reputation: 5034

Regarding the structure of a web application with user authentication

I have a single-page AngularJS web application which up until now was served as a single HTML file by my Rails server. Now that I am adding user login/authentication, it looks like I will have to restructure the way my HTML is being served. I have a two-part question:

1) Is this an acceptable way to structure the application:

The server keeps the HTML files containing the user authentication elements separate from the HTML of my Angular app. After a user is authenticated, he is then able to begin receiving the Angular HTML file.

2) Will the HTML files related to authentication always be kept separate from the HTML I'm trying to protect?

Apologies if this question is incoherent, I'm still trying to understand how these things all tie together.

Upvotes: 0

Views: 71

Answers (1)

Anton
Anton

Reputation: 7719

here is a good answer on the topic Single Page Application Authentication

Specifically to your points

The server keeps the HTML files containing the user authentication elements separate from the HTML of my Angular app. After a user is authenticated, he is then able to begin receiving the Angular HTML file.

Yes that is absolutely a good way to go, you can keep them separate. The only thing to keep in mind is that you will still have to secure the angular part by checking if they are logged in and verifying they have authority to any restful webservices you may have on the backend.

Upvotes: 1

Related Questions