Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@edgedb/auth-sveltekit

Package Overview
Dependencies
Maintainers
3
Versions
160
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@edgedb/auth-sveltekit - npm Package Compare versions

Comparing version 0.2.0-canary.20240503T160013 to 0.2.0-canary.20240503T172103

2

dist/server.d.ts

@@ -52,2 +52,4 @@ import { type RequestEvent, type Handle } from "@sveltejs/kit";

isPasswordResetTokenValid(resetToken: string): boolean | null;
private setVerifierCookie;
private setAuthCookie;
getProvidersInfo(): Promise<{

@@ -54,0 +56,0 @@ oauth: {

54

dist/server.js

@@ -44,2 +44,20 @@ import { redirect, } from "@sveltejs/kit";

}
setVerifierCookie(verifier) {
const expires = new Date(Date.now() + 1000 * 60 * 24 * 7); // In 7 days
this.cookies.set(this.config.pkceVerifierCookieName, verifier, {
httpOnly: true,
sameSite: "strict",
path: "/",
expires,
});
}
setAuthCookie(authToken) {
const expires = Auth.getTokenExpiration(authToken);
this.cookies.set(this.config.authCookieName, authToken, {
httpOnly: true,
sameSite: "strict",
path: "/",
expires: expires ?? undefined,
});
}
async getProvidersInfo() {

@@ -51,14 +69,6 @@ return (await this.core).getProvidersInfo();

const result = await (await this.core).signupWithEmailPassword(email, password, `${this.config.authRoute}/emailpassword/verify`);
this.cookies.set(this.config.pkceVerifierCookieName, result.verifier, {
httpOnly: true,
sameSite: "strict",
path: "/",
});
this.setVerifierCookie(result.verifier);
if (result.status === "complete") {
const tokenData = result.tokenData;
this.cookies.set(this.config.authCookieName, tokenData.auth_token, {
httpOnly: true,
sameSite: "strict",
path: "/",
});
this.setAuthCookie(tokenData.auth_token);
return { tokenData };

@@ -84,7 +94,3 @@ }

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: "/",
});
this.setVerifierCookie(verifier);
}

@@ -98,7 +104,3 @@ else {

const tokenData = await (await this.core).signinWithEmailPassword(email, password);
this.cookies.set(this.config.authCookieName, tokenData.auth_token, {
httpOnly: true,
sameSite: "strict",
path: "/",
});
this.setAuthCookie(tokenData.auth_token);
return { tokenData };

@@ -112,7 +114,3 @@ }

const { verifier } = await (await this.core).sendPasswordResetEmail(email, new URL(this.config.passwordResetPath, this.config.baseUrl).toString());
this.cookies.set(this.config.pkceVerifierCookieName, verifier, {
httpOnly: true,
sameSite: "strict",
path: "/",
});
this.setVerifierCookie(verifier);
}

@@ -126,7 +124,3 @@ async emailPasswordResetPassword(data) {

const tokenData = await (await this.core).resetPasswordWithResetToken(resetToken, verifier, password);
this.cookies.set(this.config.authCookieName, tokenData.auth_token, {
httpOnly: true,
sameSite: "lax",
path: "/",
});
this.setAuthCookie(tokenData.auth_token);
this.cookies.delete(this.config.pkceVerifierCookieName, {

@@ -133,0 +127,0 @@ path: "/",

{
"name": "@edgedb/auth-sveltekit",
"description": "Helper library to integrate the EdgeDB Auth extension with Sveltekit.",
"version": "0.2.0-canary.20240503T160013",
"version": "0.2.0-canary.20240503T172103",
"author": "EdgeDB <info@edgedb.com>",

@@ -6,0 +6,0 @@ "type": "module",

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