diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2021-03-05 18:08:17 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2021-03-05 18:08:17 +0100 |
| commit | d5b6a4ea27f8c905e613363aab365066ad6d9cda (patch) | |
| tree | 7cbb6a3a94cb9079800023d0bf06f7bd1b1bc55c /animism-align/cli/app/server/web.py | |
| parent | 9893a6e30f8fdbb95fc7066db851579e2a9bfe69 (diff) | |
auth stuff. generate secret and create user from the cli
Diffstat (limited to 'animism-align/cli/app/server/web.py')
| -rw-r--r-- | animism-align/cli/app/server/web.py | 4 |
1 files changed, 4 insertions, 0 deletions
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/') |
