@a-type/auth
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -29,3 +29,3 @@ import { RETURN_TO_COOKIE } from './returnTo.js'; | ||
async function handleOAuthCallbackRequest(req, opts) { | ||
var _a, _b, _c; | ||
var _a, _b, _c, _d; | ||
const url = new URL(req.url); | ||
@@ -74,3 +74,3 @@ const code = url.searchParams.get('code'); | ||
scope: tokens.scope, | ||
idToken: tokens.idToken, | ||
idToken: (_c = tokens.idToken) !== null && _c !== void 0 ? _c : null, | ||
}); | ||
@@ -81,3 +81,3 @@ } | ||
headers: { | ||
location: (_c = url.searchParams.get('returnTo')) !== null && _c !== void 0 ? _c : defaultReturnTo, | ||
location: (_d = url.searchParams.get('returnTo')) !== null && _d !== void 0 ? _d : defaultReturnTo, | ||
}, | ||
@@ -156,8 +156,8 @@ }); | ||
providerAccountId: email, | ||
refreshToken: undefined, | ||
accessToken: undefined, | ||
expiresAt: undefined, | ||
tokenType: undefined, | ||
scope: undefined, | ||
idToken: undefined, | ||
refreshToken: null, | ||
accessToken: null, | ||
expiresAt: null, | ||
tokenType: null, | ||
scope: null, | ||
idToken: null, | ||
}); | ||
@@ -164,0 +164,0 @@ await ((_b = db.insertVerificationCode) === null || _b === void 0 ? void 0 : _b.call(db, { |
@@ -23,11 +23,11 @@ export interface AuthDB { | ||
userId: string; | ||
type: 'email' | 'oidc' | 'oauth'; | ||
type: string; | ||
provider: string; | ||
providerAccountId: string; | ||
refreshToken: string | undefined; | ||
accessToken: string | undefined; | ||
expiresAt: number | undefined; | ||
tokenType: string | undefined; | ||
scope: string | undefined; | ||
idToken: string | undefined; | ||
refreshToken: string | null; | ||
accessToken: string | null; | ||
expiresAt: number | null; | ||
tokenType: string | null; | ||
scope: string | null; | ||
idToken: string | null; | ||
} | ||
@@ -34,0 +34,0 @@ export interface AuthVerificationCode { |
{ | ||
"name": "@a-type/auth", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "My personal auth request handlers", | ||
@@ -5,0 +5,0 @@ "module": "dist/esm/index.js", |
@@ -36,11 +36,11 @@ export interface AuthDB { | ||
userId: string; | ||
type: 'email' | 'oidc' | 'oauth'; | ||
type: string; | ||
provider: string; | ||
providerAccountId: string; | ||
refreshToken: string | undefined; | ||
accessToken: string | undefined; | ||
expiresAt: number | undefined; | ||
tokenType: string | undefined; | ||
scope: string | undefined; | ||
idToken: string | undefined; | ||
refreshToken: string | null; | ||
accessToken: string | null; | ||
expiresAt: number | null; | ||
tokenType: string | null; | ||
scope: string | null; | ||
idToken: string | null; | ||
} | ||
@@ -47,0 +47,0 @@ |
@@ -100,3 +100,3 @@ import { AuthDB } from './db.js'; | ||
scope: tokens.scope, | ||
idToken: tokens.idToken, | ||
idToken: tokens.idToken ?? null, | ||
}); | ||
@@ -185,8 +185,8 @@ } | ||
providerAccountId: email, | ||
refreshToken: undefined, | ||
accessToken: undefined, | ||
expiresAt: undefined, | ||
tokenType: undefined, | ||
scope: undefined, | ||
idToken: undefined, | ||
refreshToken: null, | ||
accessToken: null, | ||
expiresAt: null, | ||
tokenType: null, | ||
scope: null, | ||
idToken: null, | ||
}); | ||
@@ -193,0 +193,0 @@ await db.insertVerificationCode?.({ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57911