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

@a-type/auth

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@a-type/auth - npm Package Compare versions

Comparing version 0.4.7 to 0.4.8

6

dist/esm/handlers.js

@@ -200,6 +200,10 @@ import { AuthError } from './error.js';

if (user) {
if (!addProvidersToExistingUsers) {
if (!addProvidersToExistingUsers || user.password) {
throw new AuthError('User already exists', 409);
}
else {
await db.updateUser(user.id, {
emailVerifiedAt: new Date().toISOString(),
plaintextPassword: password,
});
userId = user.id;

@@ -206,0 +210,0 @@ }

export interface AuthDB {
insertUser(user: Omit<AuthUser, 'id'> & {
insertUser(user: Omit<AuthUser, 'id' | 'password'> & {
plaintextPassword: string | null;
}): Promise<Pick<AuthUser, 'id'>>;
updateUser(userId: string, user: Partial<Omit<AuthUser, 'id' | 'email' | 'password'> & {
plaintextPassword: string | null;
}>): Promise<void>;
insertAccount(account: Omit<AuthAccount, 'id'>): Promise<Pick<AuthAccount, 'id'>>;

@@ -20,2 +23,4 @@ getUserByEmail(email: string): Promise<AuthUser | undefined>;

imageUrl: string | null;
/** the hashed password, please. */
password: string | null;
}

@@ -22,0 +27,0 @@ export interface AuthAccount {

2

package.json
{
"name": "@a-type/auth",
"version": "0.4.7",
"version": "0.4.8",
"description": "My personal auth request handlers",

@@ -5,0 +5,0 @@ "module": "dist/esm/index.js",

export interface AuthDB {
insertUser(
user: Omit<AuthUser, 'id'> & { plaintextPassword: string | null },
user: Omit<AuthUser, 'id' | 'password'> & {
plaintextPassword: string | null;
},
): Promise<Pick<AuthUser, 'id'>>;
updateUser(
userId: string,
user: Partial<
Omit<AuthUser, 'id' | 'email' | 'password'> & {
plaintextPassword: string | null;
}
>,
): Promise<void>;
insertAccount(

@@ -32,2 +42,4 @@ account: Omit<AuthAccount, 'id'>,

imageUrl: string | null;
/** the hashed password, please. */
password: string | null;
}

@@ -34,0 +46,0 @@

@@ -287,5 +287,9 @@ import { AuthDB } from './db.js';

if (user) {
if (!addProvidersToExistingUsers) {
if (!addProvidersToExistingUsers || user.password) {
throw new AuthError('User already exists', 409);
} else {
await db.updateUser(user.id, {
emailVerifiedAt: new Date().toISOString(),
plaintextPassword: password,
});
userId = user.id;

@@ -292,0 +296,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