Skip to content
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

refactor(OAuth2)!: Rewrite auth module #661

Merged
merged 2 commits into from
May 21, 2024
Merged

refactor(OAuth2)!: Rewrite auth module #661

merged 2 commits into from
May 21, 2024

Conversation

LuanRT
Copy link
Owner

@LuanRT LuanRT commented May 21, 2024

What's Changed?

This is a rewrite of the OAuth2 module to address some bugs and inconsistencies. And since it changes the structure of the credentials, I'm marking this as a breaking change.

Note that you will have to update your existing credentials, that is if you wish to continue using them. Otherwise, simply delete them and sign in again.

Here's the new structure:

// NOTE: None of the optional properties are required. You can ignore them if your current credentials don't have them.

type OAuth2ClientID = {
  client_id: string;
  client_secret: string;
};

type OAuth2Tokens = {
  access_token: string;
  expiry_date: string;
  expires_in?: number;
  refresh_token: string;
  scope?: string;
  token_type?: string;
  client?: OAuth2ClientID;
};

The old one was a mess, full of bugs (ex., tokens being refreshed multiple times) and didn't have proper types. Note that this is a breaking change, as it changes how the credentials are stored.
@LuanRT LuanRT changed the title refactor!(OAuth2): Rewrite auth module refactor(OAuth2)!: Rewrite auth module May 21, 2024
@LuanRT LuanRT merged commit b6ce5f9 into main May 21, 2024
4 checks passed
@LuanRT LuanRT deleted the refactor/oauth2 branch May 21, 2024 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant