BUG: Fix hardcoded supertoken api key
This commit is contained in:
@@ -4,37 +4,6 @@ networks:
|
||||
driver: bridge
|
||||
#============== MIH Containers ====================================================================
|
||||
services:
|
||||
#============== Nginx Proxy Server Old ====================================================================
|
||||
# nginx:
|
||||
# container_name: nginx
|
||||
# restart: unless-stopped
|
||||
# image: nginx
|
||||
# ports:
|
||||
# - 80:80
|
||||
# - 443:443
|
||||
# volumes:
|
||||
# - ./nginx/nginx.conf:/etc/nginx/nginx.conf
|
||||
# - certbotConf:/etc/letsencrypt
|
||||
# - certbotChall:/var/www/certbot
|
||||
# depends_on:
|
||||
# - mih-ux
|
||||
# networks:
|
||||
# - mih-network
|
||||
# profiles: [ 'prod' ]
|
||||
#============== Cert Bot Old ====================================================================
|
||||
# certbot:
|
||||
# image: certbot/certbot
|
||||
# container_name: certbot
|
||||
# volumes:
|
||||
# - certbotConf:/etc/letsencrypt
|
||||
# - certbotChall:/var/www/certbot
|
||||
# #command: certonly --test-cert --webroot -w /var/www/certbot --force-renewal --email yasienmeth@gmail.com -d mzansi-innovation-hub.co.za -d www.mzansi-innovation-hub.co.za --agree-tos
|
||||
# command: certonly --webroot -w /var/www/certbot --force-renewal --email ${CERTBOT_EMAIL} -d ${CERTBOT_APP_DOMAIN} -d ${CERTBOT_API_DOMAIN} -d ${CERTBOT_STORAGE_DOMAIN} -d ${CERTBOT_MONITOR_DOMAIN} -d ${CERTBOT_AI_DOMAIN} --agree-tos
|
||||
# networks:
|
||||
# - mih-network
|
||||
# depends_on:
|
||||
# - nginx
|
||||
# profiles: [ 'withCert' ]
|
||||
#============== Nginx Proxy Manager ====================================================================
|
||||
mih-nginx:
|
||||
container_name: mih-nginx
|
||||
|
||||
@@ -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
|
||||
# )
|
||||
@@ -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=[
|
||||
|
||||
2
mih_ui/.gitignore
vendored
2
mih_ui/.gitignore
vendored
@@ -1,3 +1,5 @@
|
||||
.env
|
||||
|
||||
# Miscellaneous
|
||||
*.class
|
||||
*.log
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'dart:io';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
import 'package:flutter_native_splash/flutter_native_splash.dart';
|
||||
import 'package:flutter_web_plugins/url_strategy.dart'
|
||||
if (dart.library.html) 'package:flutter_web_plugins/url_strategy.dart';
|
||||
@@ -42,6 +43,7 @@ void main() async {
|
||||
debugPrint('APP INSTALLED!');
|
||||
});
|
||||
final GoRouter appRouter = MihGoRouter().mihRouter;
|
||||
await dotenv.load(fileName: ".env");
|
||||
FlutterNativeSplash.remove();
|
||||
runApp(MzansiInnovationHub(
|
||||
router: appRouter,
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'dart:io';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
import 'package:flutter_native_splash/flutter_native_splash.dart';
|
||||
import 'package:flutter_web_plugins/url_strategy.dart'
|
||||
if (dart.library.html) 'package:flutter_web_plugins/url_strategy.dart';
|
||||
@@ -33,6 +34,7 @@ void main() async {
|
||||
debugPrint('APP INSTALLED!');
|
||||
});
|
||||
final GoRouter appRouter = MihGoRouter().mihRouter;
|
||||
await dotenv.load(fileName: ".env");
|
||||
FlutterNativeSplash.remove();
|
||||
runApp(MzansiInnovationHub(
|
||||
router: appRouter,
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_button.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_form.dart';
|
||||
@@ -107,7 +108,7 @@ class _MihRegisterState extends State<MihRegister> {
|
||||
headers: {
|
||||
'Content-type': 'application/json',
|
||||
'Accept': 'application/json',
|
||||
"Authorization": "leatucczyixqwkqqdrhayiwzeofkltds"
|
||||
"Authorization": dotenv.env['SUPERTOKENS_API_KEY'] ?? "",
|
||||
},
|
||||
);
|
||||
//print("response 2: ${response2.statusCode}");
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_package_components/mih_button.dart';
|
||||
@@ -32,7 +33,7 @@ class MihAuthenticationServices {
|
||||
headers: {
|
||||
'Content-type': 'application/json',
|
||||
'Accept': 'application/json',
|
||||
"Authorization": "leatucczyixqwkqqdrhayiwzeofkltds"
|
||||
"Authorization": dotenv.env['SUPERTOKENS_API_KEY'] ?? "",
|
||||
},
|
||||
);
|
||||
if (response.statusCode == 200) {
|
||||
|
||||
@@ -670,6 +670,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.3.0"
|
||||
flutter_dotenv:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_dotenv
|
||||
sha256: d4130c4a43e0b13fefc593bc3961f2cb46e30cb79e253d4a526b1b5d24ae1ce4
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.0.0"
|
||||
flutter_launcher_icons:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
||||
@@ -12,6 +12,7 @@ dependencies:
|
||||
sdk: flutter
|
||||
flutter_web_plugins:
|
||||
sdk: flutter
|
||||
flutter_dotenv: ^6.0.0
|
||||
|
||||
cupertino_icons: ^1.0.8
|
||||
font_awesome_flutter: ^10.7.0
|
||||
@@ -76,6 +77,7 @@ dev_dependencies:
|
||||
flutter:
|
||||
uses-material-design: true
|
||||
assets:
|
||||
- .env
|
||||
- lib/mih_package_components/assets/images/
|
||||
- lib/mih_package_components/assets/fonts/
|
||||
- lib/mih_package_components/assets/images/loyalty_cards/
|
||||
|
||||
Reference in New Issue
Block a user