paulvanbladel / aurelia-auth

:key: Authentication plugin for aurelia
200 stars 74 forks source link

.getToken() returns null after logout and log back in. #123

Closed lukechilds closed 8 years ago

lukechilds commented 8 years ago

I've just come back to an old project that was launched about 6 months ago. Updating aurelia-auth causes users who have logged out to not be able to log back in.

I'm manually setting the headers in my API service:

headers: {
  'Authorization': () => `Bearer ${this.auth.getToken()}`
}

(this.auth is import {Authentication} from 'aurelia-auth/authentication')

If a user logs out and then logs back in again this.auth.getToken() returns null so my JWTs are invalid. Doing a hard refresh allows the user to login.

This works fine in 0.11.3, but updating to 0.11.11 gives me the null issue. Any ideas?

lukechilds commented 8 years ago

Woops, just realised you're on 2.1.3 now. Tried updating but I just get router errors :(

I'll probably just stick with 0.11.3 for the time being, we've got some major refactoring planned in the not too distant future so I'll look at upgrading then.

I couldn't see a change log anywhere, are there any issues I should be aware of using 0.11.3?

paulvanbladel commented 8 years ago

Sorry you run into trouble. The sample app aurelia-auth-sample works normal.

paulvanbladel commented 8 years ago

Luke, Is your problems solved? cheers paul.

lukechilds commented 8 years ago

No, I think I'm just gonna stick with 0.11.3.