Jump to content
  • 0

Password Reset Link Redirect Back To Login Page


Question

Posted

hello, i've update blesta to 3.4.2 but when my client request password reset, he receive the password reset mail with the password reset link inside. but when he click on that link, the page go to login page not the password reset page.

anything i should check?

 

thank you

13 answers to this question

Recommended Posts

  • 0
  • 0
Posted

The links look fine to me. Have you attempted to reset your password so you can check the email you receive? If so, does the link work?

 

If the link is fine, your customer probably clicked an old reset password link. The links are only valid for a short time (e.g. 4 hours). If the link is no longer valid when they visit it, they would be redirected to the login page. In that case, they should enter their email address on the reset password page to receive another email, and then check their email within those 4 hours.

  • 0
Posted

i did that on my own, i clicked the link just after i received the confirmation email so that before 4 hours. but just redirected to login page.

i tried that on licensecart. but his installation seems no problem.

on mine before update is okay, dont know is it because of update or not.

  • 0
Posted

i did that on my own, i clicked the link just after i received the confirmation email so that before 4 hours. but just redirected to login page.

i tried that on licensecart. but his installation seems no problem.

on mine before update is okay, dont know is it because of update or not.

 

Are you using cPanel can you check your cron job if it is? It should be /usr/local/bin/php

  • 0
Posted

the cron is running good, still can't figured it out what happened, could somebody help me?

 

look like there is problem with redirection in login page. am i right?

 

Does the direct url work fine? Without knowing the set-up we can only guess.

  • 0
Posted

hello. i try to edit app/controllers/clien_login.php

/**
	 * Confirm password reset
	 */
	public function confirmReset()  {

		$this->uses(array("Clients"));

		// Verify parameters
		if (!isset($this->get['sid']))
			$this->redirect($this->base_uri . "login/");
		
		$params = array();
		$temp = explode("|", $this->Clients->systemDecrypt($this->get['sid']));
		//print_r($temp);
		//if (count($temp) <= 1)
		//	$this->redirect($this->base_uri . "login/");
		
		foreach ($temp as $field) {
			$field = explode("=", $field, 2);
			$params[$field[0]] = $field[1];
		}
		
		// Verify reset has not expired
		//if ($params['t'] < strtotime("-" . Configure::get("Blesta.reset_password_ttl")))
			//$this->redirect($this->base_uri . "login/");
			
		// Verify hash matches
		//if ($params['h'] != substr($this->Clients->systemHash('u=' . $params['u'] . '|t=' . $params['t']), -16))
			//$this->redirect($this->base_uri . "login/");
		
		// Attempt to update the user's password and log in
		if (!empty($this->post)) {
			
			$client = $this->Clients->getByUserId($params['u']);
			$user = $this->Users->get($params['u']);
			
			if ($user && $client && $client->status == "active") {
				// Update the user's password
				$this->Users->edit($params['u'], $this->post);
				
				if (!($errors = $this->Users->errors())) {
					$this->post['username'] = $user->username;
					$this->post['password'] = $this->post['new_password'];
					$this->post['ip_address'] = (isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : "");
					
					// Attempt to log user in
					$this->Users->login($this->Session, $this->post);
					
					$this->forwardPostAuth();
				}
				else
					$this->setMessage("error", $errors);
			}
		}
	}

i comment out 3 verification :

1. if (count($temp) <= 1)

2. Verify reset has not expired

3. Verify hash matches

 

and the pages go to ask for new password like it should have.

wonder what is sid content.

 

try to print_r($temp) but just [Array ( [0] => )

 

do that mean the sid is not valid? or it can't be decrypt?

  • 0
Posted

I had a similar issue.  Make sure your company settings are correct.  In my case it had to include the www.  Even though the domain is setup to point with or without www the hostname of the server and the setup in Blesta in my case are www and it would not work without it.

 

In the email template if you are using SSL then make sure it says https:// and not http:// or it will not work correctly

  • 0
Posted

I had a similar issue.  Make sure your company settings are correct.  In my case it had to include the www.  Even though the domain is setup to point with or without www the hostname of the server and the setup in Blesta in my case are www and it would not work without it.

 

In the email template if you are using SSL then make sure it says https:// and not http:// or it will not work correctly

Thank you very much, you saved my day.

And you're right, i have redirect all call to my website to www so i have to set hostname to www.domain.com

and in email template i have to edit link(not just the shown text) to https://

 

maybe suggestion to developer to make this setting easier.

 

thanks

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...