Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Updating item only works on App restart #138

Open
vivektakrani opened this issue Sep 3, 2019 · 0 comments
Open

Updating item only works on App restart #138

vivektakrani opened this issue Sep 3, 2019 · 0 comments

Comments

@vivektakrani
Copy link

Hello,
Thank you so much for such a wonderful wrapper. It was really easy to implement.

Issue :
I am storing a token in the keychain on Login. Post login, I redirect the user to the dashboard screen where the token is passed in an API call.
Ex : Keychain: token = "XYZ"

If the token is revoked due to log in on another device, the user gets an error of authentication, here I am removing the token and redirecting user back to login.
Keychain: no token item or I can set it to empty string instead of removing.

Now, if I log in again, a new token is generated and saved in the keychain.
Keychain: token = "ABC"

Post this, when dashboard API is called, token "XYZ" is passed instead of "ABC"

This happens only in the single lifecycle of the app. If I terminate/exit the app and open again, the token passed in the API is "ABC".

How can I update the existing key in the single lifecycle of the app?
Is this the usual behavior or am I missing anything?

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

No branches or pull requests

1 participant