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
3a60c816
Commit
3a60c816
authored
Sep 26, 2017
by
Matija Obreza
Browse files
New verification tokens live for 48 hours
parent
378cd077
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/genesys2/server/service/impl/TokenVerificationServiceImpl.java
View file @
3a60c816
...
...
@@ -16,6 +16,9 @@
package
org.genesys2.server.service.impl
;
import
java.util.Calendar
;
import
java.util.Date
;
import
org.apache.commons.lang.RandomStringUtils
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
...
...
@@ -24,21 +27,17 @@ import org.genesys2.server.persistence.domain.VerificationTokenRepository;
import
org.genesys2.server.service.JPATokenStoreCleanup
;
import
org.genesys2.server.service.TokenVerificationService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.i18n.LocaleContextHolder
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Calendar
;
import
java.util.Date
;
@Service
@Transactional
(
readOnly
=
true
)
public
class
TokenVerificationServiceImpl
implements
TokenVerificationService
,
JPATokenStoreCleanup
{
private
static
final
Log
LOG
=
LogFactory
.
getLog
(
TokenVerificationServiceImpl
.
class
);
private
static
final
int
HOURS_UNTIL_INVALID
=
4
;
private
static
final
int
HOURS_UNTIL_INVALID
=
4
8
;
@Autowired
private
VerificationTokenRepository
verificationTokenRepository
;
...
...
@@ -61,8 +60,8 @@ public class TokenVerificationServiceImpl implements TokenVerificationService, J
return
token
;
}
@Override
@Transactional
@Override
@Transactional
public
void
cancel
(
String
tokenUuid
)
throws
NoSuchVerificationTokenException
{
final
VerificationToken
verificationToken
=
verificationTokenRepository
.
findByUuid
(
tokenUuid
);
if
(
verificationToken
==
null
)
{
...
...
@@ -99,7 +98,6 @@ public class TokenVerificationServiceImpl implements TokenVerificationService, J
return
verificationToken
;
}
/**
* Cleanup executed every 10 minutes
*/
...
...
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