Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Genesys Backend
Commits
0480d03e
Commit
0480d03e
authored
Sep 07, 2018
by
Matija Obreza
Browse files
Extended verification token validity to 12 days
parent
802fdc59
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/genesys2/server/service/impl/TokenVerificationServiceImpl.java
View file @
0480d03e
...
...
@@ -37,7 +37,7 @@ public class TokenVerificationServiceImpl implements TokenVerificationService, J
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
TokenVerificationServiceImpl
.
class
);
private
static
final
int
HOURS_UNTIL_INVALID
=
48
;
private
static
final
int
TOKEN_VALIDITY_HOURS
=
24
*
12
;
// 12 days
@Autowired
private
VerificationTokenRepository
verificationTokenRepository
;
...
...
@@ -52,7 +52,7 @@ public class TokenVerificationServiceImpl implements TokenVerificationService, J
token
.
setKey
(
RandomStringUtils
.
randomAlphanumeric
(
4
).
toUpperCase
());
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
add
(
Calendar
.
HOUR_OF_DAY
,
HOURS_UNTIL_INVALID
);
calendar
.
add
(
Calendar
.
HOUR_OF_DAY
,
TOKEN_VALIDITY_HOURS
);
Date
validUntil
=
calendar
.
getTime
();
token
.
setValidUntil
(
validUntil
);
...
...
Matija Obreza
@mobreza
mentioned in issue
#319 (closed)
·
Sep 07, 2018
mentioned in issue
#319 (closed)
mentioned in issue #319
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment