remix-auth-email-link
Advanced tools
Comparing version 2.0.2 to 2.1.0
import type { SessionStorage } from '@remix-run/server-runtime'; | ||
import type { AuthenticateOptions, StrategyVerifyCallback } from 'remix-auth'; | ||
import { Strategy } from 'remix-auth'; | ||
export declare type SendEmailOptions<User> = { | ||
export type SendEmailOptions<User> = { | ||
emailAddress: string; | ||
@@ -11,3 +11,3 @@ magicLink: string; | ||
}; | ||
export declare type SendEmailFunction<User> = { | ||
export type SendEmailFunction<User> = { | ||
(options: SendEmailOptions<User>): Promise<void>; | ||
@@ -20,3 +20,3 @@ }; | ||
*/ | ||
export declare type VerifyEmailFunction = { | ||
export type VerifyEmailFunction = { | ||
(email: string): Promise<void>; | ||
@@ -27,3 +27,3 @@ }; | ||
*/ | ||
export declare type MagicLinkPayload = { | ||
export type MagicLinkPayload = { | ||
/** | ||
@@ -47,3 +47,3 @@ * Email address used to authenticate. | ||
*/ | ||
export declare type EmailLinkStrategyOptions<User> = { | ||
export type EmailLinkStrategyOptions<User> = { | ||
/** | ||
@@ -115,3 +115,3 @@ * The endpoint the user will go after clicking on the email link. | ||
*/ | ||
export declare type EmailLinkStrategyVerifyParams = { | ||
export type EmailLinkStrategyVerifyParams = { | ||
email: string; | ||
@@ -118,0 +118,0 @@ form: FormData; |
@@ -37,2 +37,7 @@ "use strict"; | ||
const form = new URLSearchParams(await request.text()); | ||
const formData = new FormData(); | ||
// Convert the URLSearchParams to FormData | ||
for (const [name, value] of form) { | ||
formData.append(name, value); | ||
} | ||
// This should only be called in an action if it's used to start the login process | ||
@@ -61,3 +66,3 @@ if (request.method === 'POST') { | ||
const domainUrl = this.getDomainURL(request); | ||
const magicLink = await this.sendToken(emailAddress, domainUrl, form); | ||
const magicLink = await this.sendToken(emailAddress, domainUrl, formData); | ||
session.set(this.sessionMagicLinkKey, await this.encrypt(magicLink)); | ||
@@ -64,0 +69,0 @@ session.set(this.sessionEmailKey, emailAddress); |
{ | ||
"name": "remix-auth-email-link", | ||
"version": "2.0.2", | ||
"version": "2.1.0", | ||
"main": "./build/index.js", | ||
@@ -37,12 +37,13 @@ "types": "./build/index.d.ts", | ||
"peerDependencies": { | ||
"@remix-run/server-runtime": "^1.1.1", | ||
"remix-auth": "^3.2.1" | ||
"@remix-run/server-runtime": "^2.0.1", | ||
"remix-auth": "^3.6.0" | ||
}, | ||
"devDependencies": { | ||
"@remix-run/node": "^1.1.1", | ||
"@remix-run/react": "^1.1.1", | ||
"@remix-run/server-runtime": "^1.1.1", | ||
"@remix-run/node": "^2.0.1", | ||
"@remix-run/react": "^2.0.1", | ||
"@remix-run/server-runtime": "^2.0.1", | ||
"@types/crypto-js": "^4.1.0", | ||
"@typescript-eslint/eslint-plugin": "^5.8.1", | ||
"@typescript-eslint/parser": "^5.8.1", | ||
"core-js-pure": "^3.33.0", | ||
"eslint": "^8.5.0", | ||
@@ -53,9 +54,10 @@ "eslint-config-galex": "^3.5.3", | ||
"prettier": "^2.5.1", | ||
"react": "^17.0.2", | ||
"remix-auth": "^3.2.1", | ||
"react": "^18.0.2", | ||
"remix-auth": "^3.6.0", | ||
"ts-node": "^10.4.0", | ||
"typescript": "^4.5.4" | ||
"typescript": "^5.2.0" | ||
}, | ||
"dependencies": { | ||
"crypto-js": "^4.1.1" | ||
"crypto-js": "^4.1.1", | ||
"yarn": "^1.22.19" | ||
}, | ||
@@ -62,0 +64,0 @@ "lint-staged": { |
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
30848
394
4
16
+ Addedyarn@^1.22.19
+ Addedyarn@1.22.22(transitive)
- Removed@remix-run/router@1.7.2(transitive)
- Removed@remix-run/server-runtime@1.19.3(transitive)
- Removed@types/cookie@0.4.1(transitive)
- Removedcookie@0.4.2(transitive)