1

My application has local login and authentication in its WebAPI. Regular login would save the bearer token in a session after verifying the users password and username client side. I did so with axios.

Now i want a passwordless login for the users, by sending them a login link via email. I have written code in my WEBapi that generates a Bearer Token for the user. Ready to be sent and saved to a session.

I am not sure what to do next. I want my application to stay RESTful and not handle any sessions backend.

I could give the user a link with the Token as a query string. How can i write a front end script that would receive the token on load?

What other solution are there?

Thorbear
  • 113
  • 2
  • 10

1 Answers1

0

Write a function which is fired as soon as application loads and store the Token from query string in your localStorage or sessionStorage or indexedDB.

Adarsh
  • 46
  • 1
  • 8
  • Yes, this is it. Using the link provided by @vladimir-bogomolov solved my issue. https://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript – Thorbear Feb 28 '19 at 13:07