feat: SW-158 Tracking support
This commit is contained in:
7
auth.ts
7
auth.ts
@@ -10,13 +10,10 @@ import type { JWT } from "next-auth/jwt"
|
|||||||
import type { OIDCConfig } from "next-auth/providers"
|
import type { OIDCConfig } from "next-auth/providers"
|
||||||
|
|
||||||
function getLoginType(user: User) {
|
function getLoginType(user: User) {
|
||||||
// TODO: handle magic link, should be enough to just check for Nonce.
|
|
||||||
// if (user?.nonce) {
|
|
||||||
// return LoginTypeEnum.MagicLink
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (user?.login_with.includes("@")) {
|
if (user?.login_with.includes("@")) {
|
||||||
return LoginTypeEnum.email
|
return LoginTypeEnum.email
|
||||||
|
} else if (user?.login_with.toLowerCase() == LoginTypeEnum["email link"]) {
|
||||||
|
return LoginTypeEnum["email link"]
|
||||||
} else {
|
} else {
|
||||||
return LoginTypeEnum["membership number"]
|
return LoginTypeEnum["membership number"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export type TrackingSDKPageData = {
|
|||||||
export enum LoginTypeEnum {
|
export enum LoginTypeEnum {
|
||||||
email = "email",
|
email = "email",
|
||||||
"membership number" = "membership number",
|
"membership number" = "membership number",
|
||||||
// MagicLink = "magic link",
|
"email link" = "email link",
|
||||||
}
|
}
|
||||||
export type LoginType = keyof typeof LoginTypeEnum
|
export type LoginType = keyof typeof LoginTypeEnum
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user