@octokit/auth-oauth-device
Advanced tools
Comparing version 7.1.1 to 7.1.2
@@ -9,4 +9,3 @@ // pkg/dist-src/index.js | ||
const cachedAuthentication = getCachedAuthentication(state, options.auth); | ||
if (cachedAuthentication) | ||
return cachedAuthentication; | ||
if (cachedAuthentication) return cachedAuthentication; | ||
const { data: verification } = await createDeviceCode({ | ||
@@ -30,6 +29,4 @@ clientType: state.clientType, | ||
function getCachedAuthentication(state, auth2) { | ||
if (auth2.refresh === true) | ||
return false; | ||
if (!state.authentication) | ||
return false; | ||
if (auth2.refresh === true) return false; | ||
if (!state.authentication) return false; | ||
if (state.clientType === "github-app") { | ||
@@ -68,4 +65,3 @@ return state.authentication; | ||
} catch (error) { | ||
if (!error.response) | ||
throw error; | ||
if (!error.response) throw error; | ||
const errorType = error.response.data.error; | ||
@@ -72,0 +68,0 @@ if (errorType === "authorization_pending") { |
import { createDeviceCode, exchangeDeviceCode } from "@octokit/oauth-methods"; | ||
async function getOAuthAccessToken(state, options) { | ||
const cachedAuthentication = getCachedAuthentication(state, options.auth); | ||
if (cachedAuthentication) | ||
return cachedAuthentication; | ||
if (cachedAuthentication) return cachedAuthentication; | ||
const { data: verification } = await createDeviceCode({ | ||
@@ -24,6 +23,4 @@ clientType: state.clientType, | ||
function getCachedAuthentication(state, auth) { | ||
if (auth.refresh === true) | ||
return false; | ||
if (!state.authentication) | ||
return false; | ||
if (auth.refresh === true) return false; | ||
if (!state.authentication) return false; | ||
if (state.clientType === "github-app") { | ||
@@ -62,4 +59,3 @@ return state.authentication; | ||
} catch (error) { | ||
if (!error.response) | ||
throw error; | ||
if (!error.response) throw error; | ||
const errorType = error.response.data.error; | ||
@@ -66,0 +62,0 @@ if (errorType === "authorization_pending") { |
@@ -1,4 +0,4 @@ | ||
const VERSION = "7.1.1"; | ||
const VERSION = "7.1.2"; | ||
export { | ||
VERSION | ||
}; |
import type { RequestInterface, Route, EndpointOptions, RequestParameters, OctokitResponse } from "@octokit/types"; | ||
import * as OAuthMethodsTypes from "@octokit/oauth-methods"; | ||
import type * as OAuthMethodsTypes from "@octokit/oauth-methods"; | ||
export type ClientType = "oauth-app" | "github-app"; | ||
@@ -4,0 +4,0 @@ export type OAuthAppStrategyOptions = { |
@@ -1,1 +0,1 @@ | ||
export declare const VERSION = "7.1.1"; | ||
export declare const VERSION = "7.1.2"; |
{ | ||
"name": "@octokit/auth-oauth-device", | ||
"version": "7.1.1", | ||
"version": "7.1.2", | ||
"description": "GitHub OAuth Device authentication strategy for JavaScript", | ||
@@ -16,20 +16,18 @@ "type": "module", | ||
"dependencies": { | ||
"@octokit/oauth-methods": "^5.0.0", | ||
"@octokit/request": "^9.0.0", | ||
"@octokit/types": "^13.0.0", | ||
"@octokit/oauth-methods": "^5.1.3", | ||
"@octokit/request": "^9.1.4", | ||
"@octokit/types": "^13.6.2", | ||
"universal-user-agent": "^7.0.0" | ||
}, | ||
"devDependencies": { | ||
"@octokit/tsconfig": "^3.0.0", | ||
"@types/jest": "^29.0.0", | ||
"@types/node": "^20.0.0", | ||
"esbuild": "^0.20.0", | ||
"fetch-mock": "npm:@gr2m/fetch-mock@9.11.0-pull-request-644.1", | ||
"glob": "^10.2.7", | ||
"jest": "^29.0.0", | ||
"prettier": "3.2.5", | ||
"semantic-release": "^23.0.0", | ||
"@octokit/tsconfig": "^4.0.0", | ||
"@types/node": "^22.0.0", | ||
"@vitest/coverage-v8": "^2.1.8", | ||
"esbuild": "^0.24.0", | ||
"fetch-mock": "^11.0.0", | ||
"glob": "^11.0.0", | ||
"prettier": "3.4.2", | ||
"semantic-release-plugin-update-version-in-files": "^1.1.0", | ||
"ts-jest": "^29.0.0", | ||
"typescript": "^5.0.0" | ||
"typescript": "^5.0.0", | ||
"vitest": "^2.1.8" | ||
}, | ||
@@ -36,0 +34,0 @@ "publishConfig": { |
Sorry, the diff of this file is not supported yet
10
38612
361
+ Added@octokit/types@13.7.0(transitive)
- Removed@octokit/types@13.8.0(transitive)
Updated@octokit/request@^9.1.4
Updated@octokit/types@^13.6.2