Socket
Socket
Sign inDemoInstall

@octokit/oauth-app

Package Overview
Dependencies
Maintainers
2
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@octokit/oauth-app - npm Package Compare versions

Comparing version 2.0.4 to 2.0.5

32

dist-node/index.js

@@ -16,3 +16,3 @@ 'use strict';

const VERSION = "2.0.4";
const VERSION = "2.0.5";

@@ -131,7 +131,27 @@ function addEventHandler(state, eventName, eventHandler) {

function getAuthorizationUrlWithState(state, options) {
return getAuthorizationUrl(_objectSpread2(_objectSpread2({}, options), {}, {
clientId: options.clientId || state.clientId,
allowSignup: options.allowSignup || state.allowSignup,
baseUrl: options.baseUrl || state.baseUrl,
scopes: options.scopes || state.defaultScopes
const {
clientId = state.clientId,
allowSignup = state.allowSignup,
baseUrl = state.baseUrl,
scopes = state.defaultScopes,
// TODO: https://github.com/octokit/oauth-app.js/pull/203#issuecomment-799683991
clientType = /^lv1\./.test(clientId) ? "github-app" : "oauth-app"
} = options,
otherOptions = _objectWithoutProperties(options, ["clientId", "allowSignup", "baseUrl", "scopes", "clientType"]);
if (clientType === "oauth-app") {
return getAuthorizationUrl(_objectSpread2(_objectSpread2({}, otherOptions), {}, {
clientType: "oauth-app",
clientId,
allowSignup,
baseUrl,
scopes
}));
}
return getAuthorizationUrl(_objectSpread2(_objectSpread2({}, otherOptions), {}, {
clientType: "github-app",
clientId,
allowSignup,
baseUrl
}));

@@ -138,0 +158,0 @@ }

23

dist-src/methods/get-authorization-url.js

@@ -7,9 +7,22 @@ import { oauthAuthorizationUrl } from "@octokit/oauth-authorization-url";

export function getAuthorizationUrlWithState(state, options) {
const { clientId = state.clientId, allowSignup = state.allowSignup, baseUrl = state.baseUrl, scopes = state.defaultScopes,
// TODO: https://github.com/octokit/oauth-app.js/pull/203#issuecomment-799683991
clientType = /^lv1\./.test(clientId) ? "github-app" : "oauth-app", ...otherOptions } = options;
if (clientType === "oauth-app") {
return getAuthorizationUrl({
...otherOptions,
clientType: "oauth-app",
clientId,
allowSignup,
baseUrl,
scopes,
});
}
return getAuthorizationUrl({
...options,
clientId: options.clientId || state.clientId,
allowSignup: options.allowSignup || state.allowSignup,
baseUrl: options.baseUrl || state.baseUrl,
scopes: options.scopes || state.defaultScopes,
...otherOptions,
clientType: "github-app",
clientId,
allowSignup,
baseUrl,
});
}

@@ -1,1 +0,1 @@

export const VERSION = "2.0.4";
export const VERSION = "2.0.5";

@@ -10,5 +10,5 @@ import { State } from "../types";

};
export declare function deleteAuthorization(options: Options): Promise<unknown>;
export declare function deleteAuthorizationWithState(state: State, options: StateOptions): Promise<unknown>;
export declare function deleteAuthorization(options: Options): Promise<never>;
export declare function deleteAuthorizationWithState(state: State, options: StateOptions): Promise<never>;
export declare type AppDeleteAuthorization = (options: StateOptions) => ReturnType<typeof deleteAuthorizationWithState>;
export {};

@@ -10,5 +10,5 @@ import { State } from "../types";

};
export declare function deleteToken(options: Options): Promise<unknown>;
export declare function deleteTokenWithState(state: State, options: StateOptions): Promise<unknown>;
export declare function deleteToken(options: Options): Promise<never>;
export declare function deleteTokenWithState(state: State, options: StateOptions): Promise<never>;
export declare type AppDeleteToken = (options: StateOptions) => ReturnType<typeof deleteTokenWithState>;
export {};

@@ -1,1 +0,1 @@

export declare const VERSION = "2.0.4";
export declare const VERSION = "2.0.5";
{
"name": "@octokit/oauth-app",
"description": "GitHub OAuth toolset for Node.js",
"version": "2.0.4",
"version": "2.0.5",
"license": "MIT",

@@ -18,3 +18,3 @@ "files": [

],
"repository": "https://github.com/octokit/oauth-app.js",
"repository": "github:octokit/oauth-app.js",
"dependencies": {

@@ -24,3 +24,3 @@ "@octokit/auth-oauth-app": "^3.0.0",

"@octokit/core": "^3.0.0",
"@octokit/oauth-authorization-url": "^4.1.0",
"@octokit/oauth-authorization-url": "^4.2.1",
"@types/btoa-lite": "^1.0.0",

@@ -27,0 +27,0 @@ "btoa-lite": "^1.0.0",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc