BUG: Fix hardcoded supertoken api key

This commit is contained in:
2026-02-04 15:39:47 +02:00
parent 7d4d7fc713
commit b897986c1f
11 changed files with 26 additions and 62 deletions

View File

@@ -1,28 +0,0 @@
# from supertokens_python import init, InputAppInfo, SupertokensConfig
# from supertokens_python.recipe import emailpassword, session, dashboard
# init(
# app_info=InputAppInfo(
# app_name="MIH_API_HUB",
# api_domain="http://localhost:8080/",
# website_domain="http://mzansi-innovation-hub.co.za",
# api_base_path="/auth",
# website_base_path="/auth"
# ),
# supertokens_config=SupertokensConfig(
# # https://try.supertokens.com is for demo purposes. Replace this with the address of your core instance (sign up on supertokens.com), or self host a core.
# connection_uri="supertokens:3567/",
# api_key="leatucczyixqwkqqdrhayiwzeofkltds"
# ),
# framework='fastapi',
# recipe_list=[
# # SuperTokens.init(),
# session.init(), # initializes session features
# emailpassword.init(),
# dashboard.init(admins=[
# "yasienmeth@gmail.com",
# ],
# )
# ],
# mode='wsgi' # use wsgi instead of asgi if you are running using gunicorn
# )

View File

@@ -34,6 +34,11 @@ from supertokens_python.recipe.session.framework.fastapi import verify_session
from supertokens_python.recipe.emailverification import EmailVerificationClaim
from supertokens_python.recipe.session import SessionContainer
import os
from dotenv import load_dotenv
load_dotenv()
st_api_key = os.getenv("SUPERTOKENS_API_KEY")
origins = [
"http://localhost",
"http://localhost:80",
@@ -55,7 +60,7 @@ init(
supertokens_config=SupertokensConfig(
# https://try.supertokens.com is for demo purposes. Replace this with the address of your core instance (sign up on supertokens.com), or self host a core.
connection_uri="http://mih-supertokens:3567/",
api_key="leatucczyixqwkqqdrhayiwzeofkltds"
api_key=st_api_key
),
framework='fastapi',
recipe_list=[