Make RecoveryMode.GENERATE_NEW timed?

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

User avatar
moccha
Posts: 112
Joined: 13 Feb 2014, 16:09

Make RecoveryMode.GENERATE_NEW timed?

Postby moccha » 05 Jul 2021, 15:15

Hi again,

I'd like to make it so that the user's new generated password has a time limit before they must request a new password again. I have been told that I cannot hook into the passwordRecovery to add custom code like I can for signUp and login, though.

What's the best way to achieve this? I don't want the user to have a permanent password sitting in their email.
User avatar
Lapo
Site Admin
Posts: 22999
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Make RecoveryMode.GENERATE_NEW timed?

Postby Lapo » 06 Jul 2021, 07:39

Hi,
tt the moment there is no such option available, sorry.
We'll evaluate if it's possible to introduce something like this in the future.

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
moccha
Posts: 112
Joined: 13 Feb 2014, 16:09

Re: Make RecoveryMode.GENERATE_NEW timed?

Postby moccha » 06 Jul 2021, 15:41

:D nice! Thanks for the reply.

Do you know why mail might not be sending in Java 11? I try to send mail via the instructions here: https://smartfoxserver.com/blog/how-to- ... extension/

And when I run the code, no errors are traced out. Yet, nothing sends whatsoever.

Edit: I had a javax.activation-api-1.2.0.jar in the __lib__ folder. If I remove it, it outputs this error:

Code: Select all

java.lang.NoClassDefFoundError: javax/activation/DataSource
   com.smartfoxserver.v2.entities.managers.SFSPostOffice.sendMail(SFSPostOffice.java:216)
   com.smartfoxserver.v2.entities.managers.SFSPostOffice.sendMail(SFSPostOffice.java:206)
   sfs2x.extension.test.signup.PasswordManager.handleClientRequest(PasswordManager.java:52)
   com.smartfoxserver.v2.extensions.SFSExtension.handleClientRequest(SFSExtension.java:208)
   com.smartfoxserver.v2.controllers.v290.ExtensionReqController.processRequest(ExtensionReqController.java:174)
   com.smartfoxserver.v2.controllers.v290.ExtensionReqController$1.run(ExtensionReqController.java:68)
   java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
   java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
   java.base/java.lang.Thread.run(Thread.java:834)


However, if I do include the javax.activation jar, the error goes away but mail still doesn't not send. The built-in functions for sending email through the login assistant don't work either.

Solution: Turns out when using Java 11 I need to include the javax.activation jar in the extension as a dependency as well as place it in the __lib__ folder. When I do both of those things email works once again.
User avatar
Lapo
Site Admin
Posts: 22999
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Make RecoveryMode.GENERATE_NEW timed?

Postby Lapo » 07 Jul 2021, 07:54

Hi,
I don't think we've seen this before but good to know, we'll test the use case under Java11.
We're also in the process of updating the Java mail dependencies to a more recent build. The latest releases use a single jar instead of multiple ones which is also convenient.

We tested java Mail 1.6.2 a few weeks ago:
viewtopic.php?p=96012#p96012

cheers
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 47 guests