Implementation of Pre-Authentication feature is needed in my VueJS application for the following tasks:
- Validation of ID/Refresh Token to check if it has expired.
- If the IdToken has expired, the ability to re-generate it using the Refresh Token or alternative method.
The Cognito response provides ["expired_in" : 3600], which can be utilized.
I have done some research and discovered that HTTP Interceptors could be used for this purpose. However, I find it quite confusing on how to implement it.
I am unsure how to validate these aspects before each HTTP request within my application. It would be ideal if this can also be done upon Page Load.
Given my limited experience with VueJS, any assistance or guidance would be greatly valued.