-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
137 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 15 additions & 17 deletions
32
examples/with-multiple-email-sign-in/api-server/epOverride.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,27 @@ | ||
import { RecipeInterface } from "supertokens-node/recipe/emailpassword"; | ||
import { APIInterface } from "supertokens-node/recipe/emailpassword"; | ||
import { getPrimaryEmailFromInputEmail } from "./emailLinkingMap"; | ||
|
||
export function epOverride(oI: RecipeInterface): RecipeInterface { | ||
export function epOverride(oI: APIInterface): APIInterface { | ||
return { | ||
...oI, | ||
signIn: async function (input) { | ||
let primaryEmail = getPrimaryEmailFromInputEmail(input.email); | ||
if (primaryEmail !== undefined) { | ||
input.email = primaryEmail; | ||
} | ||
return oI.signIn(input); | ||
}, | ||
signUp: async function (input) { | ||
let primaryEmail = getPrimaryEmailFromInputEmail(input.email); | ||
signInPOST: async function (input) { | ||
const emailField = input.formFields.find((f) => f.id === "email")!; | ||
|
||
let primaryEmail = getPrimaryEmailFromInputEmail(emailField.value); | ||
if (primaryEmail !== undefined) { | ||
input.email = primaryEmail; | ||
emailField.value = primaryEmail; | ||
} | ||
return oI.signUp(input); | ||
return oI.signInPOST!(input); | ||
}, | ||
getUserByEmail: async function (input) { | ||
let primaryEmail = getPrimaryEmailFromInputEmail(input.email); | ||
signUpPOST: async function (input) { | ||
const emailField = input.formFields.find((f) => f.id === "email")!; | ||
|
||
let primaryEmail = getPrimaryEmailFromInputEmail(emailField.value); | ||
if (primaryEmail !== undefined) { | ||
input.email = primaryEmail; | ||
emailField.value = primaryEmail; | ||
} | ||
return oI.getUserByEmail(input); | ||
|
||
return oI.signUpPOST!(input); | ||
}, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
{ "imports": { "netlify:edge": "https://edge.netlify.com/v1/index.ts" } } | ||
{ | ||
"imports": { | ||
"@netlify/edge-functions": "https://edge.netlify.com/v1/index.ts", | ||
"netlify:edge": "https://edge.netlify.com/v1/index.ts?v=legacy" | ||
}, | ||
"scopes": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.