Post by vvinyl » Thu Mar 21, 2019 5:22 am

Hello everyone,

I am on OC 3.0.2.1.

I have a problem with the resetting of the passwords for customers. When a customer want's to reset their password they press forgot password. Once clicked, they receive an email and reset their password. Once on the page, they receive an error stating: "Password reset code is invalid or was used previously"

I'm not sure where to begin to diagnose this. I was wondering if I can get some guidance or if anyone has experienced this?

Thanks in advance.

Newbie

Posts

Joined
Tue Aug 07, 2018 2:25 am

Post by paulfeakins » Thu Mar 21, 2019 6:12 pm

vvinyl wrote:
Thu Mar 21, 2019 5:22 am
I'm not sure where to begin to diagnose this. I was wondering if I can get some guidance or if anyone has experienced this?
First step is usually to rule out any extensions or custom code - do you have either?

Second step is usually to work out exactly how that feature works in the code, so how is a reset code generated? Where is it stored? When is it then compared to the one in the link a customer clicks?

When a value is not what you expect (such as the code matching), tracing the value of the variable at each step is my standard debug procedure to see where it changes from the value you expect to the wrong one and why.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by Samuraiartguy » Thu Apr 16, 2020 11:48 pm

We have a new v 3.0.3.2 site that we have migrated customers over from an old 1.5.x site.
http://www.canusbshop.com
We have discovered exactly this same problem.
Was this ever solved?

Attachments

PastedGraphic-9.png

PastedGraphic-9.png (19.67 KiB) Viewed 4778 times


Newbie

Posts

Joined
Sat Sep 12, 2015 10:49 am

Post by straightlight » Thu Apr 16, 2020 11:54 pm

Samuraiartguy wrote:
Thu Apr 16, 2020 11:48 pm
We have a new v 3.0.3.2 site that we have migrated customers over from an old 1.5.x site.
http://www.canusbshop.com
We have discovered exactly this same problem.
Was this ever solved?
What ways did you used to upgrade and which PHP and mySQL library version do you currently use since you upgraded your store?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by rimho » Thu Oct 29, 2020 6:07 pm

On my installation with OC 3.0.3.2 the reset link not working was caused by the line with the reset link not having a space at the end such that the "The" from the next sentence gets incorporated in the reset code.
The fix is to either change the language definition in /catalog/language/xxx/forgotten to add a space before the sentence that gives the IP address:

Code: Select all

$_['text_ip']       = ' The IP used to make this request was: ';
This way the "The" is separated from the preceding link.

Or else edit the template file in catalog/view/theme/default/template/mail/forgotten.twig and move the two parts with the IP texts before the link address so that the latter comes last, i.e. it should look like this:

Code: Select all

{{ text_greeting }}

{{ text_ip }} 

{{ ip }}

{{ text_change }} 

{{ reset }} 
Probably the correct fix would be to insert the space in the controller/mail/forgotten.php code that composes the email, but since I already fixed it with the previous method I didn't try...

OpenCart 3.0.3.2 with "default store theme"


Newbie

Posts

Joined
Wed Jul 03, 2019 10:30 pm

Post by sw!tch » Thu Oct 29, 2020 6:23 pm

rimho wrote:
Thu Oct 29, 2020 6:07 pm
On my installation with OC 3.0.3.2 the reset link not working was caused by the line with the reset link not having a space at the end such that the "The" from the next sentence gets incorporated in the reset code.

What php version?

If you are using PHP 7.4 there is a twig bug that causes spacing issues, you would need to use PHP 7.3 or upgrade to Opencart 3.0.3.6 which has the updated twig dependency .

Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by parkookk » Tue Jul 11, 2023 8:55 pm

I use OC3038 with at least 10 extensions and zero errors.
The customer password reset seems working fine and gives the success message and I see no errors in the error logs in storage/logs however, the email has never been received to reset.

I am using English OpenCart 3.0.3.8, Default Template/Theme, php 7.4, Latest Brave Browser (No Ads-Blocker, etc.)


User avatar
Active Member

Posts

Joined
Thu Jan 17, 2013 11:56 pm
Location - london

Post by ADD Creative » Wed Jul 12, 2023 2:33 am

parkookk wrote:
Tue Jul 11, 2023 8:55 pm
I use OC3038 with at least 10 extensions and zero errors.
The customer password reset seems working fine and gives the success message and I see no errors in the error logs in storage/logs however, the email has never been received to reset.
Check the mail_forgotten event is enabled.

You could check your mail server log to see it the email got that far. In cPanel it under Track Delivery.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by parkookk » Wed Jul 12, 2023 7:05 pm

ADD Creative wrote:
Wed Jul 12, 2023 2:33 am
parkookk wrote:
Tue Jul 11, 2023 8:55 pm
I use OC3038 with at least 10 extensions and zero errors.
The customer password reset seems working fine and gives the success message and I see no errors in the error logs in storage/logs however, the email has never been received to reset.
Check the mail_forgotten event is enabled.

You could check your mail server log to see it the email got that far. In cPanel it under Track Delivery.
Yes, it's enabled. Should I disable and enable it again? If I disable it will it still be there to enable it back?

I am using English OpenCart 3.0.3.8, Default Template/Theme, php 7.4, Latest Brave Browser (No Ads-Blocker, etc.)


User avatar
Active Member

Posts

Joined
Thu Jan 17, 2013 11:56 pm
Location - london

Post by paulfeakins » Wed Jul 12, 2023 10:28 pm

parkookk wrote:
Tue Jul 11, 2023 8:55 pm
I use OC3038 with at least 10 extensions and zero errors.
The customer password reset seems working fine and gives the success message and I see no errors in the error logs in storage/logs however, the email has never been received to reset.
Do any emails from the store send?

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by parkookk » Wed Jul 12, 2023 11:14 pm

paulfeakins wrote:
Wed Jul 12, 2023 10:28 pm
parkookk wrote:
Tue Jul 11, 2023 8:55 pm
I use OC3038 with at least 10 extensions and zero errors.
The customer password reset seems working fine and gives the success message and I see no errors in the error logs in storage/logs however, the email has never been received to reset.
Do any emails from the store send?
I only get emails from the store for when a new customer has signed up and when I receive orders via an extension called "Customer order confirmation email for store owner" by Fabius.

I am using English OpenCart 3.0.3.8, Default Template/Theme, php 7.4, Latest Brave Browser (No Ads-Blocker, etc.)


User avatar
Active Member

Posts

Joined
Thu Jan 17, 2013 11:56 pm
Location - london

Post by straightlight » Thu Jul 13, 2023 12:49 am

parkookk wrote:
Wed Jul 12, 2023 11:14 pm
paulfeakins wrote:
Wed Jul 12, 2023 10:28 pm
parkookk wrote:
Tue Jul 11, 2023 8:55 pm
I use OC3038 with at least 10 extensions and zero errors.
The customer password reset seems working fine and gives the success message and I see no errors in the error logs in storage/logs however, the email has never been received to reset.
Do any emails from the store send?
I only get emails from the store for when a new customer has signed up and when I receive orders via an extension called "Customer order confirmation email for store owner" by Fabius.
If you disable that extension, does the issue persists with the emails?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by ADD Creative » Thu Jul 13, 2023 5:03 am

parkookk wrote:
Wed Jul 12, 2023 7:05 pm
ADD Creative wrote:
Wed Jul 12, 2023 2:33 am
Check the mail_forgotten event is enabled.

You could check your mail server log to see it the email got that far. In cPanel it under Track Delivery.
Yes, it's enabled. Should I disable and enable it again? If I disable it will it still be there to enable it back?
I can't see that disabling and then enabling it again would make any difference.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by paulfeakins » Thu Jul 13, 2023 7:23 pm

parkookk wrote:
Wed Jul 12, 2023 11:14 pm
I only get emails from the store for when a new customer has signed up and when I receive orders via an extension called "Customer order confirmation email for store owner" by Fabius.
Sounds like it might be good for a developer to take a look really as it's hard to know at what point it's failing.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by straightlight » Fri Jul 14, 2023 2:02 am

Or, to install the most recent OC v3.0.3.8 release and see if the issue can be produced with PHP 8.2+ as well.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by paulfeakins » Fri Jul 14, 2023 7:04 pm

straightlight wrote:
Fri Jul 14, 2023 2:02 am
Or, to install the most recent OC v3.0.3.8 release and see if the issue can be produced with PHP 8.2+ as well.
3.0.3.8 is not compatible with PHP 8.2, so don't do this.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by straightlight » Fri Jul 14, 2023 7:25 pm

paulfeakins wrote:
Fri Jul 14, 2023 7:04 pm
straightlight wrote:
Fri Jul 14, 2023 2:02 am
Or, to install the most recent OC v3.0.3.8 release and see if the issue can be produced with PHP 8.2+ as well.
3.0.3.8 is not compatible with PHP 8.2, so don't do this.
That's why I said: the most recent OC v3.0.3.8 release.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by ADD Creative » Fri Jul 14, 2023 9:42 pm

straightlight wrote:
Fri Jul 14, 2023 7:25 pm
That's why I said: the most recent OC v3.0.3.8 release.
The most recent release of 3.x was in 2021. There have been no releases of 3.x compatible with PHP 8.2. You need to download the latest work in progress on the 3.0.x.x_Maintenance branch on GitHub, which in not an official release.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by straightlight » Fri Jul 14, 2023 9:43 pm

ADD Creative wrote:
Fri Jul 14, 2023 9:42 pm
straightlight wrote:
Fri Jul 14, 2023 7:25 pm
That's why I said: the most recent OC v3.0.3.8 release.
The most recent release of 3.x was in 2021. There have been no releases of 3.x compatible with PHP 8.2. You need to download the latest work in progress on the 3.0.x.x_Maintenance branch on GitHub, which in not an official release.
Which is why, no official release was mentioned rather than the most recent.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by ADD Creative » Fri Jul 14, 2023 9:46 pm

straightlight wrote:
Fri Jul 14, 2023 9:43 pm
Which is why, no official release was mentioned rather than the most recent.
You said the most recent release which would be 3.0.3.8 from 2021, which is something different to the 3.0.x.x_Maintenance branch. Apologies, my comment was not aimed at you rather for anyone else viewing the topic .

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom
Who is online

Users browsing this forum: muko34 and 14 guests