You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Version 0.22.0 introduces ATProtocolConfiguration.resumeSession. The main use case is when a user opens your app but has already logged in (that is, they've entered their handle and password). This is a feedback form to better understand if it's useful for any workflows, or if it overlaps too much for what it's worth. Below is an explanation of what's going on with the method.
There are two ways to get the access and refresh tokens:
through the UserSession object, or
manually entering it through the accessToken and refreshToken parameters.
The parameters take precedence over the UserSession.accessToken and UserSession.refreshToken parameters.
When it grabs the tokens, it will decode them both and will check the expiry dates, beginning with the access token. If the access token's expiry date hasn't passed, then it will perform ATProtocolConfiguration.getSession to ensure it's valid.
If the access token has expired, then the method will check if the refresh token has expired. If it hasn't, then it will call ATProtocolConfiguration.refreshSession().
If the refresh token has expired, then it will throw an error, stating that both tokens have expired. At that point, it is your responsibility to call ATProtocolConfiguration.authenticate(). The reason of this is because there is the possibility that the user might have Two-Factor Authentication enabled, and as a result, you'll need to handle that properly.
My hope is that this will be a useful and shorthand method for the use case mentioned above, and I'll be improving it overtime with feedback and more testing.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Version 0.22.0 introduces
ATProtocolConfiguration.resumeSession
. The main use case is when a user opens your app but has already logged in (that is, they've entered their handle and password). This is a feedback form to better understand if it's useful for any workflows, or if it overlaps too much for what it's worth. Below is an explanation of what's going on with the method.There are two ways to get the access and refresh tokens:
UserSession
object, oraccessToken
andrefreshToken
parameters.The parameters take precedence over the
UserSession.accessToken
andUserSession.refreshToken
parameters.When it grabs the tokens, it will decode them both and will check the expiry dates, beginning with the access token. If the access token's expiry date hasn't passed, then it will perform
ATProtocolConfiguration.getSession
to ensure it's valid.If the access token has expired, then the method will check if the refresh token has expired. If it hasn't, then it will call
ATProtocolConfiguration.refreshSession()
.If the refresh token has expired, then it will throw an error, stating that both tokens have expired. At that point, it is your responsibility to call
ATProtocolConfiguration.authenticate()
. The reason of this is because there is the possibility that the user might have Two-Factor Authentication enabled, and as a result, you'll need to handle that properly.My hope is that this will be a useful and shorthand method for the use case mentioned above, and I'll be improving it overtime with feedback and more testing.
Beta Was this translation helpful? Give feedback.
All reactions