From d5b6a4ea27f8c905e613363aab365066ad6d9cda Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 5 Mar 2021 18:08:17 +0100 Subject: auth stuff. generate secret and create user from the cli --- animism-align/cli/app/server/web.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'animism-align/cli/app/server/web.py') diff --git a/animism-align/cli/app/server/web.py b/animism-align/cli/app/server/web.py index 890bd35..58754a2 100644 --- a/animism-align/cli/app/server/web.py +++ b/animism-align/cli/app/server/web.py @@ -14,6 +14,7 @@ logging.getLogger().addHandler(logging.StreamHandler()) from flask import Flask, Blueprint, send_from_directory, request from app.sql.common import db, connection_url +from app.utils.auth_utils import setup_jwt from app.settings import app_cfg from app.controllers.annotation_controller import AnnotationView @@ -33,9 +34,12 @@ def create_app(script_info=None): app.config['SQLALCHEMY_DATABASE_URI'] = connection_url app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False app.config['SERVER_NAME'] = app_cfg.SERVER_NAME + app.config['SECRET_KEY'] = app_cfg.TOKEN_SECRET + app.config['JWT_AUTH_URL_RULE'] = '/api/v1/auth/login' app.url_map.strict_slashes = False db.init_app(app) + setup_jwt(app) AnnotationView.register(app, route_prefix='/api/v1/') ParagraphView.register(app, route_prefix='/api/v1/') -- cgit v1.2.3-70-g09d2