Ionic Authentication

0

I would like some help, as I have been trying to figure out a way to do this for days, but I still can not quite understand how to do it.

I have an ionic application, where access happens through a login that gives me an access token that expires every 1 hour.

What is the best way to save this token and see if it has expired or not? And how do I check routes on ionic?

Thank you to anyone who can at least respond and give me a hand!

    
asked by anonymous 19.01.2018 / 16:16

1 answer

1

As part of the Routes check, read the LIFE CYCLE section , I think what you need is the 'ionViewCanEnter'

When the user logs in and you receive the API token, you can store this token in LocalStorage and every time you enter the page (here's what I said about "ionViewCanEnter") you check to pull this token of LocalStorage and see if it is valid.

    
26.01.2018 / 01:20