fix OAuth2 issue
This commit is contained in:
8
app.py
8
app.py
@@ -2,7 +2,7 @@
|
||||
from logging_handlers.DatabaseLogHandler import DatabaseLogHandler
|
||||
from urllib.parse import urlparse
|
||||
from api import limiter
|
||||
from flask import Flask, request
|
||||
from flask import Flask, request, url_for
|
||||
from flask_cors import CORS
|
||||
import api
|
||||
import env_provider
|
||||
@@ -23,11 +23,13 @@ try:
|
||||
except Exception as e:
|
||||
print(f"db not ready {e}")
|
||||
app = Flask(__name__)
|
||||
app.config['SERVER_NAME'] = 'localhost:5000'
|
||||
app.secret_key = env_provider.SESSION_SECRET_KEY
|
||||
CORS(app, resources={r"/api/*": {"origins": [
|
||||
"https://login.hangman-lab.top",
|
||||
"https://git.hangman-lab.top",
|
||||
"http://127.0.0.1:3000"
|
||||
"http://127.0.0.1:3000",
|
||||
"http://localhost:3000",
|
||||
]}})
|
||||
|
||||
limiter.init_app(app)
|
||||
@@ -43,4 +45,6 @@ def log_request():
|
||||
|
||||
if __name__ == '__main__':
|
||||
#logger.info("Starting app")
|
||||
with app.app_context():
|
||||
print(url_for("auth.authorize", _external=True))
|
||||
app.run(host='0.0.0.0', port=5000)
|
||||
|
||||
Reference in New Issue
Block a user