Skip to content

Not refreshing atCurrentAuthData #260

@bernica

Description

@bernica

Hi !

I've been having an issue with the "session" when using multiple tabs, and in rare cases (not reproducible yet) when using just one too.

After digging into the library code, I found the following problem: At angular2-token.service, when making a new request, it checks for this.atCurrentAuthData != null but this local variable may have old data, as another request from another app (like the same app in another tab) may have updated the localStorage with new data.

One solution could be to just read and write from and to localStorage directly. Another possibility could be to check if the local variable's data is updated before using it (it needs one read from localStorage anyways).

Hope it helps anybody and thanks for developing this library.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions