|
@@ -6,7 +6,8 @@ import typing as typing
|
6
|
6
|
|
7
|
7
|
from tracim.models.auth import User
|
8
|
8
|
|
9
|
|
-# TODO - G.M -28-03-2018 - [CurrentUser] Check if "current user" stuff is always needed for tracimv2
|
|
9
|
+# TODO - G.M -28-03-2018 - [CurrentUser][auth]
|
|
10
|
+# Check if "current user" stuff is always needed for tracimv2
|
10
|
11
|
# CURRENT_USER_WEB = 'WEB'
|
11
|
12
|
# CURRENT_USER_WSGIDAV = 'WSGIDAV'
|
12
|
13
|
|
|
@@ -55,7 +56,8 @@ class UserApi(object):
|
55
|
56
|
if email and self._user and user.user_id==self._user.user_id:
|
56
|
57
|
pass
|
57
|
58
|
# this is required for the _session to keep on being up-to-date
|
58
|
|
- # TODO - G.M - 28-03-2018 - [CurrentUser] Check for pyramid equivalent
|
|
59
|
+ # TODO - G.M - 28-03-2018 -
|
|
60
|
+ # [CurrentUser] Check for pyramid equivalent
|
59
|
61
|
# tg.request.identity['repoze.who.userid'] = email
|
60
|
62
|
# tg.auth_force_login(email)
|
61
|
63
|
|
|
@@ -95,7 +97,13 @@ class UserApi(object):
|
95
|
97
|
#from tracim.lib.calendar import CalendarManager
|
96
|
98
|
#from tracim.model.organisational import UserCalendar
|
97
|
99
|
|
98
|
|
- created_user.ensure_auth_token(session=self._session, validity_seconds=self._config.USER_AUTH_TOKEN_VALIDITY)
|
|
100
|
+ # TODO - G.M - 04-04-2018 - [auth]
|
|
101
|
+ # Check if this is already needed with
|
|
102
|
+ # new auth system
|
|
103
|
+ created_user.ensure_auth_token(
|
|
104
|
+ session=self._session,
|
|
105
|
+ validity_seconds=self._config.USER_AUTH_TOKEN_VALIDITY
|
|
106
|
+ )
|
99
|
107
|
|
100
|
108
|
# Ensure database is up-to-date
|
101
|
109
|
self._session.flush()
|
|
@@ -109,7 +117,7 @@ class UserApi(object):
|
109
|
117
|
# )
|
110
|
118
|
|
111
|
119
|
|
112
|
|
-# TODO - G.M - 28-03-2018 - [CurrentUser] Check for pyramid equivalent
|
|
120
|
+# TODO - G.M - 28-03-2018 - [CurrentUser][auth] Check for pyramid equivalent
|
113
|
121
|
# class CurrentUserGetterInterface(object):
|
114
|
122
|
# def get_current_user(self) -> typing.Union[None, User]:
|
115
|
123
|
# raise NotImplementedError()
|