3349124-redirect-after-registration/password-reset: Created the functionality...
3349124-redirect-after-registration/password-reset: Created the functionality of User Redirect After Registration/Password Reset.
Merge request reports
Activity
Filter activity
205 219 $logout = $form_state->getValue('logout'); 220 $register_redirect = $form_state->getValue('registration_redirect'); 221 $password_redirect = $form_state->getValue('password_reset_redirect'); 206 222 $users_roles = $this->getUserRoles(); 207 223 224 225 if (!empty($password_redirect) && !$this->pathValidator->isValid($password_redirect)) { 226 if (!UrlHelper::isValid($password_redirect, TRUE) && !UrlHelper::isExternal($password_redirect)) { 227 $form_state->setErrorByName('password_reset_redirect', $this->t('<strong>Password Reset Redirect URL:</strong> Redirect URL is invalid.')); 228 229 } 230 } 231 232 if (!empty($register_redirect) && !$this->pathValidator->isValid($register_redirect)) { 233 if (!UrlHelper::isValid($register_redirect, TRUE) && !UrlHelper::isExternal($register_redirect)) { 234 $form_state->setErrorByName('registration_redirect', $this->t('<strong>Password Reset Redirect URL:</strong> Redirect URL is invalid.')); 72 } 73 else { 74 // If it's a relative URL. 75 $url = Url::fromUserInput($destination); 76 } 77 78 // Redirecting the user to the specified destination. 79 $form_state->setRedirectUrl($url); 80 } 81 82 /** 83 * Implements hook_user_update(). 84 */ 85 function user_redirect_user_update(UserInterface $account) { 86 // Checking if the password has been updated. 87 // dd($account->pass->value);
Please register or sign in to reply