-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable constructing a authClient with a token #37
Comments
This is my workaround, you can do the same until the feature is implemented: https://github.com/roj1512/rtwtrbt/blob/main/auth.ts |
Simply, in your app, you can just extend the main auth class. |
+1 Working with this SDK on the backend is pretty rough, every time the backend restarts I need to go manually and set a new token. |
This is not related to this library. Twitter revokes the token after a couple of hours if you or your backend don't refresh it. |
What you describe is the correct behavior, that's why we have a refresh token. What I'm referring to is related to this library, I store the refresh token in my database, but I cannot use it when the access token expires. |
I have a token stored for multiple users. However the current sdk does not offer an option for me to
auth.OAuth2User
object using a token that I already have. Instead I always need to request an authUrl to set the internal this.token parameter.This makes the auth.OAuth2User object nearly unusable since the instance will not persist, and is used by multiple different users.
I think there should be a
setToken
method or similar, so I can internally set the token, and then us theisTokenExpired
andrefreshAuthToken
methods as normal.The text was updated successfully, but these errors were encountered: