Skip to content

Commit

Permalink
fix: remove yarn as dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
pbteja1998 committed Nov 10, 2023
1 parent 88fb2d2 commit 19fe05f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@
"typescript": "^5.2.0"
},
"dependencies": {
"crypto-js": "^4.1.1",
"yarn": "^1.22.19"
"crypto-js": "^4.1.1"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": "yarn lint",
Expand Down
11 changes: 7 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,13 @@ export class EmailLinkStrategy<User> extends Strategy<
)

const form = new URLSearchParams(await request.text())
const formData = new FormData();
const formData = new FormData()

// Convert the URLSearchParams to FormData
for (const [name, value] of form) {
formData.append(name, value);
formData.append(name, value)
}


// This should only be called in an action if it's used to start the login process
if (request.method === 'POST') {
if (!options.successRedirect) {
Expand Down Expand Up @@ -226,7 +225,11 @@ export class EmailLinkStrategy<User> extends Strategy<

const domainUrl = this.getDomainURL(request)

const magicLink = await this.sendToken(emailAddress, domainUrl, formData)
const magicLink = await this.sendToken(
emailAddress,
domainUrl,
formData
)

session.set(this.sessionMagicLinkKey, await this.encrypt(magicLink))
session.set(this.sessionEmailKey, emailAddress)
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3400,11 +3400,6 @@ [email protected]:
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.1.tgz#02fe0975d23cd441242aa7204e09fc28ac2ac33b"
integrity sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==

yarn@^1.22.19:
version "1.22.19"
resolved "https://registry.yarnpkg.com/yarn/-/yarn-1.22.19.tgz#4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447"
integrity sha512-/0V5q0WbslqnwP91tirOvldvYISzaqhClxzyUKXYxs07yUILIs5jx/k6CFe8bvKSkds5w+eiOqta39Wk3WxdcQ==

[email protected]:
version "3.1.1"
resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50"
Expand Down

0 comments on commit 19fe05f

Please sign in to comment.