kinde-oss / kinde-auth-pkce-js

Kinde vanilla JavaScript authentication for SPAs using PKCE flows. Can be used with Vue / Angular or any JS framework
https://kinde.com/docs/developer-tools/javascript-sdk/
MIT License
17 stars 11 forks source link

Feature request: Provide an `isAuthenticated` method #30

Closed DaveOrDead closed 1 year ago

DaveOrDead commented 1 year ago

Prerequisites

What is the problem you’re trying to solve?

Several of the other Kinde SDKs offer an isAuthenticated method to improve the developer experience of checking if a user is authenticated

What solution would you like to see?

Add an isAuthenticated method to the library

Additional information

No response

atifcppprogrammer commented 1 year ago

Hey @DaveOrDead I'd like a crack at this please assign this issue to me, just curious about one thing though, should the isAuthenticated method simply check if the user is authenticated i.e. the access token in memory is not yet expired or should it also attempt an initial refresh of the access token if it is expired. The kinde-nodejs-sdk for example does perform an initial refresh if the access token is expired as you can see here.

DaveOrDead commented 1 year ago

Hey @atifcppprogrammer , thanks for picking this up :)

Attempting an initial refresh sounds like a great enhancement if you're keen for it