Авторизация

+ интеграция с другими запросами
This commit is contained in:
Anton Kamalov
2024-10-22 01:29:32 +03:00
parent 339a55f8da
commit d1f513e106
7 changed files with 75 additions and 7 deletions

View File

@@ -1,22 +1,22 @@
from flask import Flask, redirect, render_template, url_for, session, request
from os import path
from Queries.req import requests_bp
import json
from Auth.auth_route import auth_bp
from checker import check_auth
app = Flask(__name__)
app.secret_key = 'super secret key'
with open(path.join(path.dirname(__file__), 'db/config.json')) as f:
app.config['db_config'] = json.load(f)
app.register_blueprint(requests_bp, url_prefix='/requests')
app.register_blueprint(requests_bp, url_prefix='/requests')
app.register_blueprint(auth_bp, url_prefix='/auth')
@app.route('/')
@check_auth
def index():
session['db_config'] = app.config['db_config'] # Временное решение до момента с авторизацией
return render_template('index.html')
return "YATTA"
@app.route('/logout')
@check_auth
def logout():
session.clear()
return 'OK'