Hello ๐ How can I check if the user jwt token is expired?
And how can I set the jwt token to expire by 30 mins rather than 60 mins as the default?
Context:
I've integrated amplify vue v6 into a vue 3 app. I'm wondering what's the best practice to check if the jwt token is expired.
At the moment I'm using fetchAuthSession function that automatically refreshes the token. Is there a way I can check against cognito if the token is expired without refreshing the token?
I want to avoid auto-refreshing the token and rather force the user to authenticate through sign-in. The only way I can think of doing this is to set a timeout variable (or check if its been 30 mins after sign-in), triggering auth.signOut, and routing the user to login screen.
Is there a better way of achieving this? ๐
Secondly, doesn't anyone have a link to cognito docs that show how to customise the token expiration? I see the default is 60 mins, but I want to set it to 30 mins.