Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authentication #62

Closed
neokeats opened this issue Sep 2, 2015 · 4 comments
Closed

Authentication #62

neokeats opened this issue Sep 2, 2015 · 4 comments
Labels

Comments

@neokeats
Copy link

neokeats commented Sep 2, 2015

Hi,
I think a starter pack should provide a way to know if a user is logged in or not.
Thought the authentication process could just mock the calls to a server.
There is not an real word application that doesn't need to know if the user can or not do the action.

A clean way to handle login and permissions with the best practice of how to handle such middleware will make it a perfect starter pack.
Just adding : https://github.com/auth0/angular2-authentication-sample
is not enough since the code is not generic enough.

@PatrickJS
Copy link
Owner

I might keep this repo as client only and move features such as this into the fullstack-angular2-starter. I can give an example of auth with cookies/jwt (prefered jwt) but the router also needs to be stable. With that said would you be fine with two starter repos (one simply client only and the other fullstack with more opinions such as auth and data management) ?

Previously the examples/ were merged into the initial app but quickly became too complex for people when starting angular2

@neokeats
Copy link
Author

neokeats commented Sep 3, 2015

Hi,
it seems great to separate both.

The middleware problem is not limited to client/server. i ve looked into angular 2, they are some things i actually doesn't see how to handle yet.
More generally how to replace the rootScope behavior.
Let's say we have an app, some stats are shown, we have a date range or datepicker somewhere.
eveything is neat and separated so we have a component that show user stats and another his team stats or country stats.
So differents/separated components, that need to know the user status(has a team or not to show him teams stats menu or no data since you have no team, same for country...) and the separated datepicker value.
From angular2-authentication-sample they extend the router to know if the user is auth or not.
But this cannot be applied to all middleware situations. A more simple case is the breadcrumb or menu active problem.
All the examples i've found doesn't show real case like this.
Maybe it can't be done yet with angular2.
The only way i see it actually is to use a singleton/localstorage to pass values between components.

@valorkin
Copy link
Contributor

it is fixed auth0-blog/angular2-authentication-sample#38
so you can try now

@PatrickJS
Copy link
Owner

the fullstack repo will have jwt authentication I'll revisit the issue when we publish it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants