Jump to content
  • 0

Password Reset Link Redirect Back To Login Page


chanx-young

Question

13 answers to this question

Recommended Posts

  • 0

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

Link to comment
Share on other sites

  • 0
  • 0

i can't find any error.

my password reset link is at https://www.domain.com/client/login/reset/

password reset confirmation link is at http://domain.com/client/login/confirmreset/?sid=hilnXxfw%2FbRW2tPOtBTG7BKjeV9%2B61qCXpNrDk7ZUnsolzPrxw7Knpg3rsrcAp5J

 

but when i clicked that link it goes to https://www.domain.com/client/login/

Link to comment
Share on other sites

  • 0

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.

Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

  • 0

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?

Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

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...