@edgedb/auth-sveltekit
Advanced tools
Comparing version 0.2.0-canary.20240408T142946 to 0.2.0-canary.20240408T143042
@@ -67,2 +67,4 @@ import { type RequestEvent, type Handle } from "@sveltejs/kit"; | ||
verification_token: string; | ||
} | { | ||
email: string; | ||
} | FormData): Promise<void>; | ||
@@ -69,0 +71,0 @@ emailPasswordSignIn(data: { |
@@ -67,4 +67,26 @@ import { redirect, } from "@sveltejs/kit"; | ||
async emailPasswordResendVerificationEmail(data) { | ||
const [verificationToken] = extractParams(data, ["verification_token"], "verification_token missing"); | ||
await (await this.core).resendVerificationEmail(verificationToken); | ||
const verificationToken = data instanceof FormData | ||
? data.get("verification_token") | ||
: "verification_token" in data | ||
? data.verification_token | ||
: null; | ||
const email = data instanceof FormData | ||
? data.get("email") | ||
: "email" in data | ||
? data.email | ||
: null; | ||
if (verificationToken) { | ||
return await (await this.core).resendVerificationEmail(verificationToken.toString()); | ||
} | ||
else if (email) { | ||
const { verifier } = await (await this.core).resendVerificationEmailForEmail(email.toString(), `${this.config.authRoute}/emailpassword/verify`); | ||
this.cookies.set(this.config.pkceVerifierCookieName, verifier, { | ||
httpOnly: true, | ||
sameSite: "strict", | ||
path: "/", | ||
}); | ||
} | ||
else { | ||
throw new InvalidDataError("expected 'verification_token' or 'email' in data"); | ||
} | ||
} | ||
@@ -71,0 +93,0 @@ async emailPasswordSignIn(data) { |
{ | ||
"name": "@edgedb/auth-sveltekit", | ||
"description": "Helper library to integrate the EdgeDB Auth extension with Sveltekit.", | ||
"version": "0.2.0-canary.20240408T142946", | ||
"version": "0.2.0-canary.20240408T143042", | ||
"author": "EdgeDB <info@edgedb.com>", | ||
@@ -6,0 +6,0 @@ "type": "module", |
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
28798
530