}
}
+ /**
+ * If multifactor authentication is enabled for the given user then
+ * - the userID will be stored in the session variables, and
+ * - `true` is returned.
+ * Otherwise,
+ * - `changeUser()` will be called, and
+ * - `false` is returned.
+ *
+ * If `true` is returned you should perform a redirect to `MultifactorAuthenticationForm`.
+ */
+ public function changeUserAfterMultifactor(User $user): bool {
+ if ($user->multifactorActive) {
+ $this->register('__changeUserAfterMultifactor__', $user->userID);
+
+ return true;
+ }
+ else {
+ $this->changeUser($user);
+
+ return false;
+ }
+ }
+
/**
* Stores a new user object in this session, e.g. a user was guest because not
* logged in, after the login his old session is used to store his full data.
email VARCHAR(191) NOT NULL DEFAULT '',
password VARCHAR(255) NOT NULL DEFAULT 'invalid:',
accessToken CHAR(40) NOT NULL DEFAULT '',
+ multifactorActive TINYINT(1) NOT NULL DEFAULT 0,
languageID INT(10) NOT NULL DEFAULT 0,
registrationDate INT(10) NOT NULL DEFAULT 0,
styleID INT(10) NOT NULL DEFAULT 0,