@supabase/gotrue-js
Advanced tools
Comparing version 1.6.1 to 1.7.0
@@ -32,2 +32,10 @@ import { Session, Provider, UserAttributes } from './lib/types'; | ||
/** | ||
* Sends a magic login link to an email address. | ||
* @param email The email address of the user. | ||
*/ | ||
sendMagicLinkEmail(email: string): Promise<{ | ||
data: {} | null; | ||
error: Error | null; | ||
}>; | ||
/** | ||
* Sends a reset request to an email address. | ||
@@ -34,0 +42,0 @@ * @param email The email address of the user. |
@@ -51,2 +51,17 @@ "use strict"; | ||
/** | ||
* Sends a magic login link to an email address. | ||
* @param email The email address of the user. | ||
*/ | ||
sendMagicLinkEmail(email) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
try { | ||
const data = yield fetch_1.post(`${this.url}/magiclink`, { email }, { headers: this.headers }); | ||
return { data, error: null }; | ||
} | ||
catch (error) { | ||
return { data: null, error }; | ||
} | ||
}); | ||
} | ||
/** | ||
* Sends a reset request to an email address. | ||
@@ -53,0 +68,0 @@ * @param email The email address of the user. |
@@ -92,3 +92,7 @@ "use strict"; | ||
this._removeSession(); | ||
let { email, password, provider } = credentials; | ||
const { email, password, provider } = credentials; | ||
if (email && !password) { | ||
const { error } = yield this.api.sendMagicLinkEmail(email); | ||
return { data: null, user: null, error }; | ||
} | ||
if (email && password) | ||
@@ -95,0 +99,0 @@ return this._handeEmailSignIn(email, password); |
@@ -32,2 +32,10 @@ import { Session, Provider, UserAttributes } from './lib/types'; | ||
/** | ||
* Sends a magic login link to an email address. | ||
* @param email The email address of the user. | ||
*/ | ||
sendMagicLinkEmail(email: string): Promise<{ | ||
data: {} | null; | ||
error: Error | null; | ||
}>; | ||
/** | ||
* Sends a reset request to an email address. | ||
@@ -34,0 +42,0 @@ * @param email The email address of the user. |
@@ -49,2 +49,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
/** | ||
* Sends a magic login link to an email address. | ||
* @param email The email address of the user. | ||
*/ | ||
sendMagicLinkEmail(email) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
try { | ||
const data = yield post(`${this.url}/magiclink`, { email }, { headers: this.headers }); | ||
return { data, error: null }; | ||
} | ||
catch (error) { | ||
return { data: null, error }; | ||
} | ||
}); | ||
} | ||
/** | ||
* Sends a reset request to an email address. | ||
@@ -51,0 +66,0 @@ * @param email The email address of the user. |
@@ -87,3 +87,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
this._removeSession(); | ||
let { email, password, provider } = credentials; | ||
const { email, password, provider } = credentials; | ||
if (email && !password) { | ||
const { error } = yield this.api.sendMagicLinkEmail(email); | ||
return { data: null, user: null, error }; | ||
} | ||
if (email && password) | ||
@@ -90,0 +94,0 @@ return this._handeEmailSignIn(email, password); |
{ | ||
"name": "@supabase/gotrue-js", | ||
"version": "1.6.1", | ||
"version": "1.7.0", | ||
"description": "Isomorphic GoTrue client", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
128961
1985