/** * Performs the login * * Basically, this only checks if `loginUser` in TSFE is TRUE. The authentication * itself is handled by the TYPO3.CMS core which "listens" on submission of the * user + pass POST parameters. * * @return void * * @throws UnsupportedRequestTypeException If not in web context */ public function loginAction() { try { $this->guard->assertAuthenticatedUser(); $this->redirect('show', 'SecretSanta\\RevealDonee'); } catch (UnauthenticatedException $exc) { $flashMessageQueue = $this->controllerContext->getFlashMessageQueue(); $this->flashMessageFactory->createError('login.failed')->enqueueIn($flashMessageQueue); $this->redirect('form'); } }
/** * Shows the donee to the logged in donor * * @return void */ public function showAction() { try { $this->guard->assertAuthenticatedUser(); $donee = $this->doneeResolver->resolveFor(FrontendUserId::fromLoggedInUser()); $this->view->assign('donee', $donee); } catch (UnauthenticatedException $exc) { $flashMessageQueue = $this->controllerContext->getFlashMessageQueue(); $this->flashMessageFactory->createInfo('login.unauthorized')->enqueueIn($flashMessageQueue); $this->redirect('form', 'SecretSanta\\AccessControl'); } }