annotate client/src/lib/session.js @ 216:494a257e7715

Called schema prefixed sys_admin.create_user instead of create_user.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 24 Jul 2018 11:20:46 +0200
parents 4bf2173748f3
children 27502291e564
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
162
9908260d1e6a Refactor: Login expiry refactored to lib
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
1 function sessionStillActive(expiresFromPastSession) {
9908260d1e6a Refactor: Login expiry refactored to lib
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
2 if (!expiresFromPastSession) return false;
9908260d1e6a Refactor: Login expiry refactored to lib
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
3 const now = Date.now();
165
4bf2173748f3 refactor: extracted the string to milisecondconversion
Thomas Junk <thomas.junk@intevation.de>
parents: 163
diff changeset
4 const stillActive = now < expiresFromPastSession;
162
9908260d1e6a Refactor: Login expiry refactored to lib
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
5 return stillActive;
9908260d1e6a Refactor: Login expiry refactored to lib
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
6 }
9908260d1e6a Refactor: Login expiry refactored to lib
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
7
165
4bf2173748f3 refactor: extracted the string to milisecondconversion
Thomas Junk <thomas.junk@intevation.de>
parents: 163
diff changeset
8 function toMillisFromString(timestring) {
4bf2173748f3 refactor: extracted the string to milisecondconversion
Thomas Junk <thomas.junk@intevation.de>
parents: 163
diff changeset
9 return timestring * 1000;
4bf2173748f3 refactor: extracted the string to milisecondconversion
Thomas Junk <thomas.junk@intevation.de>
parents: 163
diff changeset
10 }
4bf2173748f3 refactor: extracted the string to milisecondconversion
Thomas Junk <thomas.junk@intevation.de>
parents: 163
diff changeset
11
4bf2173748f3 refactor: extracted the string to milisecondconversion
Thomas Junk <thomas.junk@intevation.de>
parents: 163
diff changeset
12 export { sessionStillActive, toMillisFromString };