Skip to content

Commit 8fae727

Browse files
committed
Merge remote-tracking branch 'origin/develop'
2 parents a8b5e79 + 864d7e9 commit 8fae727

File tree

39 files changed

+3955
-5039
lines changed

39 files changed

+3955
-5039
lines changed

.github/workflows/sphinx.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Build Sphinx Documentation"
1+
name: 'Build Sphinx Documentation'
22

33
on:
44
release:
@@ -30,12 +30,11 @@ jobs:
3030
- uses: actions/checkout@master
3131
with:
3232
fetch-depth: 0
33-
ref: update-doc
3433

3534
- name: Setup node
3635
uses: actions/setup-node@v3
3736
with:
38-
node-version: lts/gallium
37+
node-version: lts/iron
3938

4039
- name: Install JS librairies
4140
working-directory: ./frontend

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.14.1
1+
2.14.2

backend/geonature/app.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ def create_app(with_external_mods=True):
133133
if "CELERY" in app.config:
134134
from geonature.utils.celery import celery_app
135135

136+
celery_app.init_app(app)
136137
celery_app.conf.update(app.config["CELERY"])
137138

138139
# Emails configuration

backend/geonature/core/auth/routes.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@
1919
session,
2020
Response,
2121
)
22+
from flask_login import login_user
23+
import sqlalchemy as sa
2224
from sqlalchemy import select
2325
from utils_flask_sqla.response import json_resp
2426

27+
from pypnusershub.db import models
2528
from pypnusershub.db.models import User, Organisme, Application
2629
from pypnusershub.db.tools import encode_token
2730
from pypnusershub.routes import insert_or_update_organism, insert_or_update_role
@@ -94,7 +97,9 @@ def loginCas():
9497
.id_application
9598
)
9699
token = encode_token(data)
97-
response.set_cookie("token", token, expires=cookie_exp)
100+
101+
token_exp = datetime.datetime.now(datetime.timezone.utc)
102+
token_exp += datetime.timedelta(seconds=current_app.config["COOKIE_EXPIRATION"])
98103

99104
# User cookie
100105
organism_id = info_user["codeOrganisme"]
@@ -111,7 +116,15 @@ def loginCas():
111116
"id_role": data["id_role"],
112117
"id_organisme": organism_id,
113118
}
114-
response.set_cookie("current_user", str(current_user), expires=cookie_exp)
119+
120+
# Log the user in
121+
user = db.session.execute(
122+
sa.select(models.User)
123+
.where(models.User.identifiant == current_user["user_login"])
124+
.where(models.User.filter_by_app())
125+
).scalar_one()
126+
login_user(user)
127+
115128
return response
116129
else:
117130
log.info("Erreur d'authentification lié au CAS, voir log du CAS")

0 commit comments

Comments
 (0)