remix-auth-email-link
Advanced tools
Comparing version 1.4.1 to 1.4.2
@@ -128,5 +128,5 @@ import type { SessionStorage } from '@remix-run/server-runtime'; | ||
authenticate(request: Request, sessionStorage: SessionStorage, options: AuthenticateOptions): Promise<User>; | ||
getMagicLink(emailAddress: string, domainUrl: string, form: FormData): Promise<string>; | ||
private getDomainURL; | ||
private sendToken; | ||
private getMagicLink; | ||
private createMagicLinkPayload; | ||
@@ -133,0 +133,0 @@ private encrypt; |
@@ -117,2 +117,11 @@ "use strict"; | ||
} | ||
async getMagicLink(emailAddress, domainUrl, form) { | ||
const payload = this.createMagicLinkPayload(emailAddress, form); | ||
const stringToEncrypt = JSON.stringify(payload); | ||
const encryptedString = await this.encrypt(stringToEncrypt); | ||
const url = new URL(domainUrl); | ||
url.pathname = this.callbackURL; | ||
url.searchParams.set(this.magicLinkSearchParam, encryptedString); | ||
return url.toString(); | ||
} | ||
getDomainURL(request) { | ||
@@ -145,11 +154,2 @@ var _a; | ||
} | ||
async getMagicLink(emailAddress, domainUrl, form) { | ||
const payload = this.createMagicLinkPayload(emailAddress, form); | ||
const stringToEncrypt = JSON.stringify(payload); | ||
const encryptedString = await this.encrypt(stringToEncrypt); | ||
const url = new URL(domainUrl); | ||
url.pathname = this.callbackURL; | ||
url.searchParams.set(this.magicLinkSearchParam, encryptedString); | ||
return url.toString(); | ||
} | ||
createMagicLinkPayload(emailAddress, form) { | ||
@@ -156,0 +156,0 @@ return { |
{ | ||
"name": "remix-auth-email-link", | ||
"version": "1.4.1", | ||
"version": "1.4.2", | ||
"main": "./build/index.js", | ||
@@ -5,0 +5,0 @@ "types": "./build/index.d.ts", |
# Email Link Strategy - Remix Auth | ||
> This strategy is heavily based on **kcd** strategy present in the v2 of [Remix Auth](https://github.com/sergiodxa/remix-auth/blob/main/docs/strategies/kcd.md). The major difference being we are using `crypto-js` instead of `crypto` so that it can be deployed on CF. | ||
> This strategy is heavily based on **kcd** strategy present in the [v2 of Remix Auth](https://github.com/sergiodxa/remix-auth/blob/v2.6.0/docs/strategies/kcd.md). The major difference being we are using `crypto-js` instead of `crypto` so that it can be deployed on CF. | ||
@@ -5,0 +5,0 @@ The Email Link Strategy implements the authentication strategy used on [kentcdodds.com](https://kentcdodds.com). |
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
29511