Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
pilcrowonpaper committed Mar 28, 2024
1 parent 0a760a8 commit 40aa2b0
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .changesets/94a8i.minor.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Add Roblox provider.
Add Roblox provider.
2 changes: 1 addition & 1 deletion .changesets/hu3zn.minor.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Add VK provider.
Add VK provider.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github: pilcrowOnPaper
github: pilcrowOnPaper
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ We welcome all contributions to the docs, especially grammar fixes. Arctic uses

## Contributing to the source code

We are open to most contributions, but please open a new issue before creating a pull request, especially for new features. It's likely your PR will be rejected if not. We have intentionally limited the scope of the project and we would like to keep the package lean.
We are open to most contributions, but please open a new issue before creating a pull request, especially for new features. It's likely your PR will be rejected if not. We have intentionally limited the scope of the project and we would like to keep the package lean.

### Set up

Expand Down
2 changes: 1 addition & 1 deletion docs/pages/providers/yandex.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ const response = await fetch("https://api.tracker.yandex.net/v2/myself", {
}
});
const user = await response.json();
```
```
21 changes: 9 additions & 12 deletions src/providers/roblox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,15 @@ export class Roblox implements OAuth2ProviderWithPKCE {
code: string,
codeVerifier: string
): Promise<RobloxTokens> {
const result = await this.client.validateAuthorizationCode<TokenResponseBody>(
code,
{
credentials: this.clientSecret,
codeVerifier
}
);
const result = await this.client.validateAuthorizationCode<TokenResponseBody>(code, {
credentials: this.clientSecret,
codeVerifier
});
const tokens: RobloxTokens = {
accessToken: result.access_token,
refreshToken: result.refresh_token,
accessTokenExpiresAt: createDate(new TimeSpan(result.expires_in, "s")),
idToken: result.id_token
idToken: result.id_token
};
return tokens;
}
Expand All @@ -60,7 +57,7 @@ export class Roblox implements OAuth2ProviderWithPKCE {
accessToken: result.access_token,
refreshToken: result.refresh_token,
accessTokenExpiresAt: createDate(new TimeSpan(result.expires_in, "s")),
idToken: result.id_token
idToken: result.id_token
};
return tokens;
}
Expand All @@ -70,12 +67,12 @@ interface TokenResponseBody {
access_token: string;
refresh_token: string;
expires_in: number;
id_token: string
id_token: string;
}

export interface RobloxTokens {
accessToken: string;
refreshToken: string;
accessTokenExpiresAt: Date;
idToken: string
}
idToken: string;
}
12 changes: 8 additions & 4 deletions src/providers/yandex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ export class Yandex implements OAuth2Provider {
private client: OAuth2Client;
private clientSecret: string;

constructor(clientId: string, clientSecret: string, options?: {
redirectURI: string
}) {
constructor(
clientId: string,
clientSecret: string,
options?: {
redirectURI: string;
}
) {
this.client = new OAuth2Client(clientId, authorizeEndpoint, tokenEndpoint, {
redirectURI: options?.redirectURI
});
Expand All @@ -27,7 +31,7 @@ export class Yandex implements OAuth2Provider {
): Promise<URL> {
return await this.client.createAuthorizationURL({
state,
scopes: options?.scopes ?? [],
scopes: options?.scopes ?? []
});
}

Expand Down

0 comments on commit 40aa2b0

Please sign in to comment.