@meistrari/auth-core 1.20.0 → 1.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +2 -3
- package/dist/index.d.ts +2 -3
- package/dist/index.mjs +9 -3
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -5258,8 +5258,6 @@ type SignInWithEmailAndPasswordOptions = {
|
|
|
5258
5258
|
password: string;
|
|
5259
5259
|
/** URL to redirect to after successful authentication. */
|
|
5260
5260
|
callbackURL: string;
|
|
5261
|
-
/** URL to redirect to if authentication fails. */
|
|
5262
|
-
errorCallbackURL?: string;
|
|
5263
5261
|
};
|
|
5264
5262
|
|
|
5265
5263
|
/**
|
|
@@ -5357,8 +5355,9 @@ declare class SessionService {
|
|
|
5357
5355
|
* @param options - Email/password sign-in configuration
|
|
5358
5356
|
* @param options.email - User's email address
|
|
5359
5357
|
* @param options.password - User's password
|
|
5358
|
+
* @param options.callbackURL - URL to redirect to after successful authentication
|
|
5360
5359
|
*/
|
|
5361
|
-
signInWithEmailAndPassword({ email, password, }: SignInWithEmailAndPasswordOptions): Promise<void>;
|
|
5360
|
+
signInWithEmailAndPassword({ email, password, callbackURL, }: SignInWithEmailAndPasswordOptions): Promise<void>;
|
|
5362
5361
|
/**
|
|
5363
5362
|
* Signs out the currently authenticated user.
|
|
5364
5363
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -5258,8 +5258,6 @@ type SignInWithEmailAndPasswordOptions = {
|
|
|
5258
5258
|
password: string;
|
|
5259
5259
|
/** URL to redirect to after successful authentication. */
|
|
5260
5260
|
callbackURL: string;
|
|
5261
|
-
/** URL to redirect to if authentication fails. */
|
|
5262
|
-
errorCallbackURL?: string;
|
|
5263
5261
|
};
|
|
5264
5262
|
|
|
5265
5263
|
/**
|
|
@@ -5357,8 +5355,9 @@ declare class SessionService {
|
|
|
5357
5355
|
* @param options - Email/password sign-in configuration
|
|
5358
5356
|
* @param options.email - User's email address
|
|
5359
5357
|
* @param options.password - User's password
|
|
5358
|
+
* @param options.callbackURL - URL to redirect to after successful authentication
|
|
5360
5359
|
*/
|
|
5361
|
-
signInWithEmailAndPassword({ email, password, }: SignInWithEmailAndPasswordOptions): Promise<void>;
|
|
5360
|
+
signInWithEmailAndPassword({ email, password, callbackURL, }: SignInWithEmailAndPasswordOptions): Promise<void>;
|
|
5362
5361
|
/**
|
|
5363
5362
|
* Signs out the currently authenticated user.
|
|
5364
5363
|
*
|
package/dist/index.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import { defaultStatements } from 'better-auth/plugins/organization/access';
|
|
|
8
8
|
import z$1, { z } from 'zod';
|
|
9
9
|
export { APIError } from 'better-auth';
|
|
10
10
|
|
|
11
|
-
const version = "1.20.
|
|
11
|
+
const version = "1.20.1";
|
|
12
12
|
|
|
13
13
|
const statements = {
|
|
14
14
|
...defaultStatements,
|
|
@@ -960,14 +960,20 @@ class SessionService {
|
|
|
960
960
|
* @param options - Email/password sign-in configuration
|
|
961
961
|
* @param options.email - User's email address
|
|
962
962
|
* @param options.password - User's password
|
|
963
|
+
* @param options.callbackURL - URL to redirect to after successful authentication
|
|
963
964
|
*/
|
|
964
965
|
async signInWithEmailAndPassword({
|
|
965
966
|
email,
|
|
966
|
-
password
|
|
967
|
+
password,
|
|
968
|
+
callbackURL
|
|
967
969
|
}) {
|
|
970
|
+
if (!isValidUrl(callbackURL)) {
|
|
971
|
+
throw new InvalidCallbackURL(`Invalid callback URL: ${callbackURL}`);
|
|
972
|
+
}
|
|
968
973
|
await this.client.signIn.email({
|
|
969
974
|
email,
|
|
970
|
-
password
|
|
975
|
+
password,
|
|
976
|
+
callbackURL
|
|
971
977
|
});
|
|
972
978
|
}
|
|
973
979
|
/**
|