Display the password reset view for the given token.

@param  string  $token
@return Response
180953
public function getReset($token = null)
    {
        if (is_null($token)) App::abort(404);

        return View::make('bumble::reset.reset')->with('token', $token);
    }
931210
public function show($token)
    {
        $memberInvitation = MemberInvitation::where('token', $token)->first();
        if (empty($memberInvitation)) {
            return view('combine::response.member-invitation.not-found');
        }
        switch ($memberInvitation->member->user->status) {
            case 'Invited':
                return $this->respondAcceptNewUser($memberInvitation);
            case 'Accepted':
                return $this->respondOnboardNewUser($memberInvitation);
            default:
                return $this->respondAcceptExistingUser($memberInvitation);
        }
    }
538251
public static function findByPasswordResetToken(string $token) : ?self
    {
        if (!static::isPasswordResetTokenValid($token)) {
            return null;
        }
        return static::findOne([
            'password_reset_token' => $token,
            'status' => self::STATUS_ACTIVE,
        ]);
    }
175361
public function exists($token)
    {
        $reset = PasswordReset::where('token', $token)->first();
        return $reset and ! $reset->isExpired();
    }
1240745
public function resetAction($token)
    {
        $user = $this->container->get('fos_user.user_manager')->findUserByConfirmationToken($token);

        if (null === $user) {
            throw new NotFoundHttpException(sprintf('The user with "confirmation token" does not exist for value "%s"', $token));
        }

        if (!$user->isPasswordRequestNonExpired($this->container->getParameter('fos_user.resetting.token_ttl'))) {
            return new RedirectResponse($this->container->get('router')->generate('sonata_user_resetting_request'));
        }

        $form = $this->container->get('bruery.user.resetting.form');
        $formHandler = $this->container->get('bruery.user.resetting.form.handler');
        $process = $formHandler->process($user);

        if ($process) {
            if ($user->isEnabled() &&
                !$user->isLocked() &&
                !($user->isCredentialsExpired() || ($user->getCredentialsExpireAt() && $user->getCredentialsExpireAt()->diff(new \DateTime()) >= 0))  &&
                !($user->isExpired() || ($user->getExpiresAt() && $user->getExpiresAt()->diff(new \DateTime()) >= 0))) {
                $this->setFlash('bruery_user_success', 'resetting.flash.success');
                $response = new RedirectResponse($this->getRedirectionUrl($user));
                $this->authenticateUser($user, $response);
            } else {
                $response = new RedirectResponse($this->container->get('router')->generate('sonata_user_security_login'));
                $this->setFlash('bruery_user_error', 'account.flash.error');
            }
            return $response;
        }

        $template = $this->container->get('bruery_core.template_loader')->getTemplates();

        return $this->container->get('templating')->renderResponse($template['bruery_user.template.resetting.form'], array(
            'token' => $token,
            'form' => $form->createView(),
        ));
    }
1369100
public function resetAction(Request $request, $token)
    {
        if ($this->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_FULLY')) {
            return new RedirectResponse($this->get('router')->generate('sonata_admin_dashboard'));
        }

        /** @var $formFactory \FOS\UserBundle\Form\Factory\FactoryInterface */
        $formFactory = $this->get('fos_user.resetting.form.factory');
        /** @var $userManager \FOS\UserBundle\Model\UserManagerInterface */
        $userManager = $this->get('fos_user.user_manager');
        /** @var $loginManager \FOS\UserBundle\Security\LoginManagerInterface */
        $loginManager = $this->get('fos_user.security.login_manager');

        $user = $userManager->findUserByConfirmationToken($token);

        $firewallName = $this->container->getParameter('fos_user.firewall_name');

        if (null === $user) {
            throw new NotFoundHttpException(sprintf('The user with "confirmation token" does not exist for value "%s"', $token));
        }

        if (!$user->isPasswordRequestNonExpired($this->container->getParameter('fos_user.resetting.token_ttl'))) {
            return new RedirectResponse($this->generateUrl('sonata_user_admin_resetting_request'));
        }

        $form = $formFactory->createForm();
        $form->setData($user);

        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            $user->setConfirmationToken(null);
            $user->setPasswordRequestedAt(null);
            $user->setEnabled(true);

            $message = $this->get('translator')->trans('resetting.flash.success', [], 'FOSUserBundle');
            $this->addFlash('success', $message);
            $response = new RedirectResponse($this->generateUrl('sonata_admin_dashboard'));

            try {
                $loginManager->logInUser($firewallName, $user, $response);
                $user->setLastLogin(new \DateTime());
            } catch (AccountStatusException $ex) {
                // We simply do not authenticate users which do not pass the user
                // checker (not enabled, expired, etc.).
                if ($this->has('logger')) {
                    $this->get('logger')->warning(sprintf(
                        'Unable to login user %d after password reset',
                        $user->getId())
                    );
                }
            }

            $userManager->updateUser($user);

            return $response;
        }

        return $this->render('NetworkingInitCmsBundle:Admin:Security/Resetting/reset.html.twig', [
            'token' => $token,
            'form' => $form->createView(),
            'base_template' => $this->get('sonata.admin.pool')->getTemplate('layout'),
            'admin_pool' => $this->get('sonata.admin.pool'),
        ]);
    }
288101
public function showResetForm(Request $request, $token = null)
    {
        pageinfo([
            'title' => __('auth.reset'),
            'robots' => 'noindex, follow',
        ]);

        return $this->makeResponse('passwords.reset', ['token' => $token, 'email' => $request->email]);
    }
1070701
public function showNewPassword($token)
    {
        try {
            $token = decrypt($token);

            [$authorId, $token] = explode('|', $token);

            $author = WinkAuthor::findOrFail($authorId);
        } catch (Throwable $e) {
            return redirect()->route('wink.password.forgot')->with('invalidResetToken', true);
        }

        if (cache('password.reset.'.$authorId) != $token) {
            return redirect()->route('wink.password.forgot')->with('invalidResetToken', true);
        }

        cache()->forget('password.reset.'.$authorId);

        $author->password = \Hash::make($password = Str::random());

        $author->save();

        return view('wink::reset-password', [
            'password' => $password,
        ]);
    }
780021
public function getEmailByToken($token)
    {
        $reminder = $this->getReminder()
            ->where('token', '=', $token)
            ->where('created_at', '>=', $this->getOldestValidDate())
            ->first();

        return $reminder->email;
    }
1016303
public function setToken($token = null)
    {
        if ( ! $token and $this->session->has('googleapi_token') )
        {
            $token = $this->session->get('googleapi_token');
        }

        return $this->client->setAccessToken($token);
    }
1307433
public function actionPassword($token)
    {
        if ($this->module->userComponent !== true) {
            $this->info(Yii::t('podium/flash', 'Please contact the administrator to change your account password.'));
            return $this->module->goPodium();
        }

        $model = User::findByPasswordResetToken($token);
        if (!$model) {
            $this->error(Yii::t('podium/flash', 'The provided password reset token is invalid or expired.'));
            return $this->module->goPodium();
        }
        $model->scenario = 'passwordChange';
        if ($model->load(Yii::$app->request->post()) && $model->changePassword()) {
            Log::info('Password changed', $model->id, __METHOD__);
            $this->success(Yii::t('podium/flash', 'Your account password has been changed.'));
            return $this->module->goPodium();
        }
        return $this->render('password', ['model' => $model]);
    }
1368021
public function actionResetPassword($token)
    {
        try {
            $model = new ResetPasswordForm($token);
        } catch (InvalidParamException $e) {
            throw new BadRequestHttpException($e->getMessage());
        }

        if ($model->load(Yii::$app->getRequest()->post()) && $model->validate() && $model->resetPassword()) {
            Yii::$app->getSession()->setFlash('success', yii::t('cms', 'New password was saved.'));

            return $this->goHome();
        }

        return $this->render('resetPassword', [
            'model' => $model,
        ]);
    }
987401
protected function resetCsrfToken($token=null)
    {
        $token || $token = $this->request->getParam($this->options['csrfTokenName']);
        FormToken::instance()->reset($token);
    }
1088768
public function resetAction(Request $request, PasswordResetToken $token): Response
    {
        $user = $this->userRepositoryCollection->findUserByToken($token);

        if ($user === null) {
            return new RedirectResponse(
                $this->router->generate('multi_user_login')
            );
        }

        $changePasswordTransferObject = ChangePasswordDataTransferObject::forUser($user);
        $form = $this->formFactory->create(ChangePasswordType::class, $changePasswordTransferObject);

        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            $this->resetPasswordHandler->handle($form->getData());

            $this->flashBag->add(
                'success',
                $this->translator->trans(
                    'sumocoders.multiuserbundle.flash.password_reset_success'
                )
            );

            return new RedirectResponse(
                $this->router->generate('multi_user_login')
            );
        }

        return $this->templating->renderResponse(
            'SumoCodersFrameworkMultiUserBundle:PasswordReset:reset.html.twig',
            [
                'form' => $form->createView(),
            ]
        );
    }
4770
static public function resetCaptcha($token=null)
    {
        if (!$token) {
            $token = isset($_POST['_form_token']) ? $_POST['_form_token'] : null;
        }
        
        return Captcha::instance()->reset($token);
    }
508516
public static function findByPasswordResetToken($token, $status = self::STATUS_ACTIVE)
    {
        if (!static::isPasswordResetTokenValid($token)) {
            return null;
        }
        if ($status == null) {
            return static::find()->where(['password_reset_token' => $token])->limit(1)->one();
        }
        return static::find()->where(['password_reset_token' => $token, 'status' => $status])->limit(1)->one();
    }
459885
public function showResetForm(Request $request, $token = null)
    {
        return hcview('HCACL::password.reset')->with(
            ['token' => $token, 'email' => $request->email]
        );
    }