ng-token-auth icon indicating copy to clipboard operation
ng-token-auth copied to clipboard

Angular 2

Open szechyjs opened this issue 10 years ago • 12 comments

Do you have any plans of supporting angular 2?

szechyjs avatar Feb 04 '16 19:02 szechyjs

Yes, when I have the time. Feel free to submit a PR.

lynndylanhurley avatar Feb 04 '16 19:02 lynndylanhurley

@lynndylanhurley My project is making use of Angular 2. Is there any progress on this or any way I can help?

ghost avatar Mar 26 '16 23:03 ghost

we should add a "need help" tag to this.

angelxmoreno avatar May 09 '16 14:05 angelxmoreno

Is there somebody that is using it on angular 2? I am trying to use it in an hybrid app with angular 1+2 but I am not able to understand how to do it. If someone has some links how to understand it to share it would be wunderful.

Blundert avatar Jun 27 '16 15:06 Blundert

+1 for this.

For now (test purpose with ng2) am just using the demo to know which params are needed for some routes as register, signin, signout. And i am thinking about implmenting the extraction of the token my self and readd for the next request. 2nd response give some different options to do this: http://stackoverflow.com/questions/35375530/how-do-i-add-a-json-web-token-to-each-header

nasreddineskandrani avatar Jul 03 '16 17:07 nasreddineskandrani

@blundert solution src/services/server/index.ts (need some more refactor to cover all cases)

get it work in a 'ng2 http service wrapper' that implement the reinsertion of authorization for subsequent http call in angular2. someone need to adapt this for a wanted* ng2-token-auth version

use case implemented I call register or signin action (post) and after that with the fields received in the response header, i make a call (get) to a "restricted" route reinserting these fields in the request header this time => working :)

commit: https://github.com/nasreddineskandrani/ma3ri-client/commit/be9d2361c2f4389f0b698ff923e2f373b94772a8

backend under "devise_token_auth" gem.

nasreddineskandrani avatar Jul 03 '16 23:07 nasreddineskandrani

I recently extracted the token service I used in an Angular2 project. It supports multiple user types and works with the "devise_token_auth" gem out of the box. It is pretty basic for now and any contribution is greatly appreciated.

https://github.com/neroniaky/angular2-token

neroniaky avatar Aug 09 '16 08:08 neroniaky

@neroniaky - if you're ready for a potential influx of users to your project, we can add a README update to point ng2 users to your repo. feel free to submit a PR and i'll merge.

booleanbetrayal avatar Aug 09 '16 17:08 booleanbetrayal

@booleanbetrayal - sounds awesome! Gonna need another 2-3 days to add a few things, like proper tests. Will submit a PR by the end of this week.

neroniaky avatar Aug 09 '16 20:08 neroniaky

@booleanbetrayal do you think it makes sense to add the same reference to jToker and devise token auth too? I just finished an example app, which should fit with the other examples.

neroniaky avatar Aug 23 '16 08:08 neroniaky

@neroniaky - That sounds reasonable to me. Want to get the PRs in order?

booleanbetrayal avatar Aug 23 '16 15:08 booleanbetrayal

@booleanbetrayal Thanks! I'm on it.

neroniaky avatar Aug 25 '16 06:08 neroniaky