Skip to content

Commit 20a55fe

Browse files
committed
Invalidate token after using it not before
1 parent ab9c5bb commit 20a55fe

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/controllers/User/Activate.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,16 @@ public function &run( Router &$router, View &$view, array &$args ) {
4141
}
4242

4343
if ( $model->user ) {
44-
$model->user->invalidateVerificationToken();
4544
$user_token = $model->user->getVerificationToken();
4645

4746
if ( $user_token === $model->token ) {
47+
$model->user->invalidateVerificationToken();
48+
4849
if (!$model->user->setVerified()) {
4950
$model->error = 'INTERNAL_ERROR';
5051
} else {
5152
$model->error = false;
53+
5254
Logger::logEvent(
5355
EventTypes::USER_VERIFIED,
5456
$model->user_id,

0 commit comments

Comments
 (0)