Socket
Socket
Sign inDemoInstall

arctic

Package Overview
Dependencies
37
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.8.1 to 0.9.0

3

dist/providers/apple.d.ts

@@ -7,4 +7,3 @@ import type { OAuth2Provider } from "../index.js";

createAuthorizationURL(state: string, options?: {
responseMode?: "query" | "form_post";
scope?: string[];
scopes?: string[];
}): Promise<URL>;

@@ -11,0 +10,0 @@ validateAuthorizationCode(code: string): Promise<AppleTokens>;

@@ -18,6 +18,5 @@ import { TimeSpan, createDate } from "oslo";

const url = await this.client.createAuthorizationURL({
state,
scope: options?.scope ?? []
scopes: options?.scopes
});
url.searchParams.set("response_mode", options?.responseMode ?? "query");
url.searchParams.set("state", state);
return url;

@@ -24,0 +23,0 @@ }

@@ -7,3 +7,3 @@ import type { OAuth2Provider } from "../index.js";

createAuthorizationURL(codeVerifier: string, options?: {
scope?: string[];
scopes?: string[];
}): Promise<URL>;

@@ -10,0 +10,0 @@ validateAuthorizationCode(code: string): Promise<AtlassianTokens>;

@@ -17,3 +17,3 @@ import { OAuth2Client } from "oslo/oauth2";

codeVerifier,
scope: options?.scope ?? []
scopes: options?.scopes
});

@@ -20,0 +20,0 @@ url.searchParams.set("audience", "api.atlassian.com");

@@ -8,3 +8,3 @@ import type { OAuth2Provider } from "../index.js";

createAuthorizationURL(state: string, options?: {
scope?: string[];
scopes?: string[];
}): Promise<URL>;

@@ -11,0 +11,0 @@ validateAuthorizationCode(code: string): Promise<Auth0Tokens>;

@@ -16,8 +16,8 @@ import { OAuth2Client } from "oslo/oauth2";

async createAuthorizationURL(state, options) {
const scope = options?.scope ?? [];
scope.push("openid");
return await this.client.createAuthorizationURL({
state,
scope: options?.scope ?? []
const scopes = options?.scopes ?? [];
const url = await this.client.createAuthorizationURL({
scopes: [...scopes, "openid"]
});
url.searchParams.set("state", state);
return url;
}

@@ -24,0 +24,0 @@ async validateAuthorizationCode(code) {

@@ -7,3 +7,3 @@ import type { OAuth2Provider } from "../index.js";

createAuthorizationURL(state: string, options?: {
scope?: string[];
scopes?: string[];
}): Promise<URL>;

@@ -10,0 +10,0 @@ validateAuthorizationCode(code: string): Promise<BitbucketTokens>;

@@ -15,6 +15,7 @@ import { OAuth2Client } from "oslo/oauth2";

async createAuthorizationURL(state, options) {
return await this.client.createAuthorizationURL({
state,
scope: options?.scope ?? []
const url = await this.client.createAuthorizationURL({
scopes: options?.scopes ?? []
});
url.searchParams.set("state", state);
return url;
}

@@ -21,0 +22,0 @@ async validateAuthorizationCode(code) {

@@ -7,3 +7,3 @@ import type { OAuth2Provider } from "../index.js";

createAuthorizationURL(state: string, options?: {
scope?: string[];
scopes?: string[];
}): Promise<URL>;

@@ -10,0 +10,0 @@ validateAuthorizationCode(code: string): Promise<DiscordTokens>;

@@ -15,6 +15,7 @@ import { OAuth2Client } from "oslo/oauth2";

async createAuthorizationURL(state, options) {
return await this.client.createAuthorizationURL({
state,
scope: options?.scope ?? []
const url = await this.client.createAuthorizationURL({
scopes: options?.scopes ?? []
});
url.searchParams.set("state", state);
return url;
}

@@ -21,0 +22,0 @@ async validateAuthorizationCode(code) {

@@ -7,4 +7,3 @@ import type { OAuth2Provider } from "../index.js";

createAuthorizationURL(state: string, options?: {
scope?: string[];
accessType?: "online" | "offline";
scopes?: string[];
}): Promise<URL>;

@@ -11,0 +10,0 @@ validateAuthorizationCode(code: string): Promise<DropboxTokens>;

@@ -15,9 +15,7 @@ import { OAuth2Client } from "oslo/oauth2";

async createAuthorizationURL(state, options) {
const scope = options?.scope ?? [];
scope.push("openid");
const scopes = options?.scopes ?? [];
const url = await this.client.createAuthorizationURL({
state,
scope
scopes: [...scopes, "openid"]
});
url.searchParams.set("token_access_type", options?.accessType ?? "online");
url.searchParams.set("state", state);
return url;

@@ -24,0 +22,0 @@ }

@@ -7,3 +7,3 @@ import type { OAuth2Provider } from "../index.js";

createAuthorizationURL(state: string, options?: {
scope?: string[];
scopes?: string[];
}): Promise<URL>;

@@ -10,0 +10,0 @@ validateAuthorizationCode(code: string): Promise<FacebookTokens>;

@@ -15,6 +15,7 @@ import { OAuth2Client } from "oslo/oauth2";

async createAuthorizationURL(state, options) {
return await this.client.createAuthorizationURL({
state,
scope: options?.scope
const url = await this.client.createAuthorizationURL({
scopes: options?.scopes ?? []
});
url.searchParams.set("state", state);
return url;
}

@@ -21,0 +22,0 @@ async validateAuthorizationCode(code) {

@@ -7,3 +7,3 @@ import type { OAuth2Provider } from "../index.js";

createAuthorizationURL(state: string, options?: {
scope?: string[];
scopes?: string[];
}): Promise<URL>;

@@ -10,0 +10,0 @@ validateAuthorizationCode(code: string): Promise<FigmaTokens>;

@@ -16,5 +16,5 @@ import { TimeSpan, createDate } from "oslo";

const url = await this.client.createAuthorizationURL({
state,
scope: options?.scope ?? []
scopes: options?.scopes ?? []
});
url.searchParams.set("state", state);
return url;

@@ -21,0 +21,0 @@ }

@@ -9,3 +9,3 @@ import type { OAuth2Provider } from "../index.js";

createAuthorizationURL(state: string, options?: {
scope?: string[];
scopes?: string[];
}): Promise<URL>;

@@ -12,0 +12,0 @@ validateAuthorizationCode(code: string): Promise<GitHubTokens>;

@@ -14,6 +14,7 @@ import { OAuth2Client } from "oslo/oauth2";

async createAuthorizationURL(state, options) {
return await this.client.createAuthorizationURL({
state,
scope: options?.scope ?? []
const url = await this.client.createAuthorizationURL({
scopes: options?.scopes ?? []
});
url.searchParams.set("state", state);
return url;
}

@@ -20,0 +21,0 @@ async validateAuthorizationCode(code) {

@@ -9,3 +9,3 @@ import type { OAuth2Provider } from "../index.js";

createAuthorizationURL(state: string, options?: {
scope?: string[];
scopes?: string[];
}): Promise<URL>;

@@ -12,0 +12,0 @@ validateAuthorizationCode(code: string): Promise<GitLabTokens>;

@@ -16,6 +16,7 @@ import { OAuth2Client } from "oslo/oauth2";

async createAuthorizationURL(state, options) {
return await this.client.createAuthorizationURL({
state,
scope: options?.scope ?? []
const url = await this.client.createAuthorizationURL({
scopes: options?.scopes ?? []
});
url.searchParams.set("state", state);
return url;
}

@@ -22,0 +23,0 @@ async validateAuthorizationCode(code) {

@@ -7,4 +7,3 @@ import type { OAuth2ProviderWithPKCE } from "../index.js";

createAuthorizationURL(codeVerifier: string, options?: {
scope?: string[];
accessType?: "online" | "offline";
scopes?: string[];
}): Promise<URL>;

@@ -11,0 +10,0 @@ validateAuthorizationCode(code: string, codeVerifier: string): Promise<GoogleTokens>;

@@ -15,10 +15,8 @@ import { TimeSpan, createDate } from "oslo";

async createAuthorizationURL(codeVerifier, options) {
const scope = options?.scope ?? [];
scope.push("openid");
const scopes = options?.scopes ?? [];
const url = await this.client.createAuthorizationURL({
codeVerifier,
scope
scopes: [...scopes, "openid"]
});
url.searchParams.set("nonce", "_");
url.searchParams.set("access_type", options?.accessType ?? "online");
return url;

@@ -25,0 +23,0 @@ }

@@ -7,3 +7,3 @@ import type { OAuth2Provider } from "../index.js";

createAuthorizationURL(state: string, options?: {
scope?: string[];
scopes?: string[];
}): Promise<URL>;

@@ -10,0 +10,0 @@ validateAuthorizationCode(code: string): Promise<KakaoTokens>;

@@ -15,6 +15,7 @@ import { TimeSpan, createDate } from "oslo";

async createAuthorizationURL(state, options) {
return await this.client.createAuthorizationURL({
state,
scope: options?.scope ?? []
const url = await this.client.createAuthorizationURL({
scopes: options?.scopes ?? []
});
url.searchParams.set("state", state);
return url;
}

@@ -21,0 +22,0 @@ async validateAuthorizationCode(code) {

@@ -8,3 +8,3 @@ import type { OAuth2ProviderWithPKCE } from "../index.js";

createAuthorizationURL(codeVerifier: string, options?: {
scope?: string[];
scopes?: string[];
}): Promise<URL>;

@@ -11,0 +11,0 @@ validateAuthorizationCode(code: string, codeVerifier: string): Promise<KeycloakTokens>;

@@ -17,8 +17,8 @@ import { OAuth2Client } from "oslo/oauth2";

async createAuthorizationURL(codeVerifier, options) {
const scope = options?.scope ?? [];
scope.push("openid");
return await this.client.createAuthorizationURL({
const scopes = options?.scopes ?? [];
const url = await this.client.createAuthorizationURL({
codeVerifier,
scope
scopes: [...scopes, "openid"]
});
return url;
}

@@ -25,0 +25,0 @@ async validateAuthorizationCode(code, codeVerifier) {

@@ -7,3 +7,3 @@ import type { OAuth2ProviderWithPKCE } from "../index.js";

createAuthorizationURL(codeVerifier: string, options?: {
scope?: string[];
scopes?: string[];
}): Promise<URL>;

@@ -10,0 +10,0 @@ validateAuthorizationCode(code: string, codeVerifier: string): Promise<LineTokens>;

@@ -15,9 +15,9 @@ import { OAuth2Client, generateState } from "oslo/oauth2";

async createAuthorizationURL(codeVerifier, options) {
const scope = options?.scope ?? [];
scope.push("openid");
return await this.client.createAuthorizationURL({
state: generateState(),
const scopes = options?.scopes ?? [];
const url = await this.client.createAuthorizationURL({
codeVerifier,
scope
scopes: [...scopes, "openid"]
});
url.searchParams.set("state", generateState());
return url;
}

@@ -24,0 +24,0 @@ async validateAuthorizationCode(code, codeVerifier) {

@@ -7,3 +7,3 @@ import type { OAuth2Provider } from "../index.js";

createAuthorizationURL(state: string, options?: {
scope?: string[];
scopes?: string[];
}): Promise<URL>;

@@ -10,0 +10,0 @@ validateAuthorizationCode(code: string): Promise<LinkedInTokens>;

@@ -15,8 +15,8 @@ import { OAuth2Client } from "oslo/oauth2";

async createAuthorizationURL(state, options) {
const scope = options?.scope ?? [];
scope.push("openid");
return await this.client.createAuthorizationURL({
state,
scope
const scopes = options?.scopes ?? [];
const url = await this.client.createAuthorizationURL({
scopes: [...scopes, "openid"]
});
url.searchParams.set("state", state);
return url;
}

@@ -23,0 +23,0 @@ async validateAuthorizationCode(code) {

@@ -7,3 +7,3 @@ import type { OAuth2ProviderWithPKCE } from "../index.js";

createAuthorizationURL(codeVerifier: string, options?: {
scope?: string[];
scopes?: string[];
}): Promise<URL>;

@@ -10,0 +10,0 @@ validateAuthorizationCode(code: string, codeVerifier: string): Promise<MicrosoftEntraIdTokens>;

@@ -15,7 +15,6 @@ import { TimeSpan, createDate } from "oslo";

async createAuthorizationURL(codeVerifier, options) {
const scope = options?.scope ?? [];
scope.push("openid");
const scopes = options?.scopes ?? [];
const url = await this.client.createAuthorizationURL({
codeVerifier,
scope
scopes: [...scopes, "openid"]
});

@@ -22,0 +21,0 @@ url.searchParams.set("nonce", "_");

@@ -14,6 +14,4 @@ import { OAuth2Client } from "oslo/oauth2";

async createAuthorizationURL(state) {
const url = await this.client.createAuthorizationURL({
state
});
url.searchParams.set("owner", "user");
const url = await this.client.createAuthorizationURL();
url.searchParams.set("state", state);
return url;

@@ -20,0 +18,0 @@ }

@@ -7,4 +7,3 @@ import type { OAuth2Provider } from "../index.js";

createAuthorizationURL(state: string, options?: {
tokenDuration?: "permanent" | "temporary";
scope?: string[];
scopes?: string[];
}): Promise<URL>;

@@ -11,0 +10,0 @@ validateAuthorizationCode(code: string): Promise<RedditTokens>;

@@ -16,6 +16,5 @@ import { OAuth2Client } from "oslo/oauth2";

const url = await this.client.createAuthorizationURL({
state,
scope: options?.scope ?? []
scopes: options?.scopes ?? []
});
url.searchParams.set("duration", options?.tokenDuration ?? "temporary");
url.searchParams.set("state", state);
return url;

@@ -22,0 +21,0 @@ }

@@ -7,3 +7,3 @@ import type { OAuth2Provider } from "../index.js";

createAuthorizationURL(state: string, options?: {
scope?: string[];
scopes?: string[];
}): Promise<URL>;

@@ -10,0 +10,0 @@ validateAuthorizationCode(code: string): Promise<SlackTokens>;

@@ -14,8 +14,8 @@ import { OAuth2Client } from "oslo/oauth2";

async createAuthorizationURL(state, options) {
const scope = options?.scope ?? [];
scope.push("openid");
return await this.client.createAuthorizationURL({
state,
scope
const scopes = options?.scopes ?? [];
const url = await this.client.createAuthorizationURL({
scopes: [...scopes, "openid"]
});
url.searchParams.set("state", state);
return url;
}

@@ -22,0 +22,0 @@ async validateAuthorizationCode(code) {

@@ -7,3 +7,3 @@ import type { OAuth2Provider } from "../index.js";

createAuthorizationURL(state: string, options?: {
scope?: string[];
scopes?: string[];
}): Promise<URL>;

@@ -10,0 +10,0 @@ validateAuthorizationCode(code: string): Promise<SpotifyTokens>;

@@ -15,6 +15,7 @@ import { TimeSpan, createDate } from "oslo";

async createAuthorizationURL(state, options) {
return await this.client.createAuthorizationURL({
state,
scope: options?.scope ?? []
const url = await this.client.createAuthorizationURL({
scopes: options?.scopes ?? []
});
url.searchParams.set("state", state);
return url;
}

@@ -21,0 +22,0 @@ async validateAuthorizationCode(code) {

@@ -7,3 +7,3 @@ import type { OAuth2Provider } from "../index.js";

createAuthorizationURL(state: string, options?: {
scope?: string[];
scopes?: string[];
}): Promise<URL>;

@@ -10,0 +10,0 @@ validateAuthorizationCode(code: string): Promise<TwitchTokens>;

@@ -15,6 +15,7 @@ import { TimeSpan, createDate } from "oslo";

async createAuthorizationURL(state, options) {
return await this.client.createAuthorizationURL({
state,
scope: options?.scope ?? []
const url = await this.client.createAuthorizationURL({
scopes: options?.scopes ?? []
});
url.searchParams.set("state", state);
return url;
}

@@ -21,0 +22,0 @@ async validateAuthorizationCode(code) {

@@ -7,3 +7,3 @@ import type { OAuth2ProviderWithPKCE } from "../index.js";

createAuthorizationURL(codeVerifier: string, options?: {
scope?: string[];
scopes?: string[];
}): Promise<URL>;

@@ -10,0 +10,0 @@ validateAuthorizationCode(code: string, codeVerifier: string): Promise<TwitterTokens>;

@@ -14,7 +14,8 @@ import { OAuth2Client, generateState } from "oslo/oauth2";

async createAuthorizationURL(codeVerifier, options) {
return await this.client.createAuthorizationURL({
state: generateState(),
const url = await this.client.createAuthorizationURL({
codeVerifier,
scope: options?.scope ?? []
scopes: options?.scopes
});
url.searchParams.set("state", generateState());
return url;
}

@@ -21,0 +22,0 @@ async validateAuthorizationCode(code, codeVerifier) {

@@ -7,3 +7,3 @@ import type { OAuth2Provider } from "../index.js";

createAuthorizationURL(state: string, options?: {
scope?: string[];
scopes?: string[];
}): Promise<URL>;

@@ -10,0 +10,0 @@ validateAuthorizationCode(code: string): Promise<YahooTokens>;

@@ -15,8 +15,8 @@ import { OAuth2Client } from "oslo/oauth2";

async createAuthorizationURL(state, options) {
const scope = options?.scope ?? [];
scope.push("openid");
return await this.client.createAuthorizationURL({
state,
scope: options?.scope ?? []
const scopes = options?.scopes ?? [];
const url = await this.client.createAuthorizationURL({
scopes: [...scopes, "openid"]
});
url.searchParams.set("state", state);
return url;
}

@@ -23,0 +23,0 @@ async validateAuthorizationCode(code) {

{
"name": "arctic",
"type": "module",
"version": "0.8.1",
"version": "0.9.0",
"description": "OAuth 2.0 with built-in providers",

@@ -27,3 +27,3 @@ "main": "dist/index.js",

"dependencies": {
"oslo": "0.23.5"
"oslo": "0.24.0"
},

@@ -30,0 +30,0 @@ "scripts": {

# Arctic
Arctic is an OAuth 2.0 library for JavaScript/TypeScript that supports numerous providers. It's light weight, fully-typed, and runtime-agnostic.
Arctic is an OAuth 2.0 library for JavaScript/TypeScript that supports numerous providers. It's light weight, fully-typed, and runtime-agnostic. [Read the documentation →](./docs/main.md)

@@ -12,3 +12,3 @@ ```ts

const authorizationURL = await github.createAuthorizationURL(state, {
scope: ["user:email"]
scopes: ["user:email"]
});

@@ -19,4 +19,2 @@

[Read the documentation](./docs/main.md)
> For a more flexible OAuth 2.0 client, see [`oslo/oauth2`](http://github.com/pilcrowonpaper/oslo).

@@ -23,0 +21,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc