mirror of
https://github.com/Xevion/runnerspace.git
synced 2025-12-15 18:13:02 -06:00
protections added
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from flask import Flask
|
||||
from flask_sqlalchemy import SQLAlchemy
|
||||
from flask_login import LoginManager
|
||||
|
||||
# init SQLAlchemy
|
||||
db = SQLAlchemy()
|
||||
@@ -12,6 +13,18 @@ def create_app():
|
||||
|
||||
db.init_app(app)
|
||||
|
||||
login_manager = LoginManager()
|
||||
login_manager.login_view = 'auth.login'
|
||||
login_manager.init_app(app)
|
||||
|
||||
from .models import User
|
||||
|
||||
@login_manager.user_loader
|
||||
def load_user(user_id):
|
||||
return User.query.get(int(user_id))
|
||||
|
||||
# idk if i need the rest of this shit below
|
||||
|
||||
# blueprint for auth routes in app
|
||||
from .auth import auth as auth_blueprint
|
||||
app.register_blueprint(auth_blueprint)
|
||||
|
||||
Reference in New Issue
Block a user