include supertokens api key
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import SuperTokens from "supertokens-node";
|
||||
import Session from "supertokens-node/recipe/session";
|
||||
import { TypeInput } from "supertokens-node/types";
|
||||
import Dashboard from "supertokens-node/recipe/dashboard";
|
||||
import UserRoles from "supertokens-node/recipe/userroles";
|
||||
import { appInfo } from "./config";
|
||||
import PasswordlessDevelopmentMode from "./recipes/passwordless-development-mode";
|
||||
import { logger } from "./";
|
||||
import PasswordlessTwilioVerify from "./recipes/passwordless-twilio-verify";
|
||||
import { logger } from "./";
|
||||
import type { TypeInput } from "supertokens-node/types";
|
||||
|
||||
export const backendConfig = (): TypeInput => {
|
||||
return {
|
||||
@@ -14,25 +14,26 @@ export const backendConfig = (): TypeInput => {
|
||||
supertokens: {
|
||||
connectionURI:
|
||||
process.env.SUPERTOKENS_URI || "https://try.supertokens.io",
|
||||
apiKey: process.env.SUPERTOKENS_API_KEY || undefined,
|
||||
},
|
||||
appInfo,
|
||||
recipeList: [
|
||||
//PasswordlessTwilioVerify.init(),
|
||||
PasswordlessDevelopmentMode.init(),
|
||||
process.env.NODE_ENV === 'production'
|
||||
? PasswordlessTwilioVerify.init()
|
||||
: PasswordlessDevelopmentMode.init(),
|
||||
Session.init({
|
||||
cookieSameSite: "lax",
|
||||
cookieSecure: import.meta.env.NODE_ENV === "production",
|
||||
cookieDomain:
|
||||
import.meta.env.NODE_ENV === "production" ? ".example.com" : undefined,
|
||||
antiCsrf: import.meta.env.NODE_ENV === "production" ? "VIA_TOKEN" : "NONE",
|
||||
cookieSecure: process.env.NODE_ENV === "production",
|
||||
cookieDomain: process.env.COOKIE_DOMAIN || undefined,
|
||||
antiCsrf: process.env.NODE_ENV === "production" ? "VIA_TOKEN" : "NONE",
|
||||
|
||||
// Debug only
|
||||
exposeAccessTokenToFrontendInCookieBasedAuth: true,
|
||||
exposeAccessTokenToFrontendInCookieBasedAuth: process.env.NODE_ENV !== "production",
|
||||
}),
|
||||
Dashboard.init(),
|
||||
UserRoles.init(),
|
||||
],
|
||||
telemetry: import.meta.env.NODE_ENV !== "production",
|
||||
telemetry: process.env.NODE_ENV !== "production",
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user