https://kotlinlang.org logo
#javascript
Title
# javascript
d

Daniel Schönfelder

01/18/2023, 9:19 AM
Hey Community! I write a little Kotlin/JS application with a login. At the moment i hold the auth token in the cache and after a browser reload the user has to be to login again. Now i'm struggling a little bit to fix that. Can someone give me a tip, what is a good solution to hold the token at a browser reload?
Maybe not the best but one solution is to use the localStorage (https://kotlinlang.org/api/latest/jvm/stdlib/kotlinx.browser/local-storage.html).
a

Andromadus Naruto

01/18/2023, 2:03 PM
Yes. Using local storage is the popular solution.
d

Daniel Schönfelder

01/18/2023, 2:03 PM
Great, thank you very much!
👍🏾 1
d

David Herman

01/19/2023, 1:49 AM
It's even an official recommendation from the Firebase docs: https://firebase.google.com/docs/auth/web/email-link-auth#security_concerns
d

Daniel Schönfelder

01/19/2023, 6:48 AM
Thank you David!
👍 1
7 Views