Skip to content

Commit 3ee259a

Browse files
committed
Use auth module from qwc_services_core
1 parent 1e2a5ec commit 3ee259a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/server.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
from flask_ldap3_login import LDAP3LoginManager, AuthenticationResponseStatus
1717
from flask_ldap3_login.forms import LDAPLoginForm
1818
import i18n
19-
from qwc_services_core.jwt import jwt_manager
20-
from qwc_services_core.auth import GroupNameMapper
19+
from qwc_services_core.auth import auth_manager, GroupNameMapper, optional_auth
2120
from qwc_services_core.runtime_config import RuntimeConfig
2221
from qwc_services_core.tenant_handler import (
2322
TenantHandler, TenantPrefixMiddleware, TenantSessionInterface)
@@ -32,7 +31,7 @@
3231
app.config['JWT_ACCESS_TOKEN_EXPIRES'] = int(os.environ.get(
3332
'JWT_ACCESS_TOKEN_EXPIRES', 12*3600))
3433

35-
jwt = jwt_manager(app)
34+
jwt = auth_manager(app)
3635
app.secret_key = app.config['JWT_SECRET_KEY']
3736

3837
i18n.set('load_path', [os.path.join(
@@ -282,7 +281,7 @@ def verify_login():
282281

283282

284283
@app.route('/logout', methods=['GET', 'POST'])
285-
@jwt_required(optional=True)
284+
@optional_auth
286285
def logout():
287286
target_url = url_path(request.args.get('url', '/'))
288287
resp = make_response(redirect(target_url))

0 commit comments

Comments
 (0)