Since most of my users log in using MagicUrl, I also hope that users can set a password after logging in so that they can log in with it in exceptional circumstances. Now, I want to check if the user has already set their password to determine whether to use the updatePassword or createRecovery and updateRecovery methods to set their password. How to check?
Summary
To determine if a user has set a password for their account, you can look at the `passwordUpdate` attribute on the User. If the attribute is null or empty, it means the user has not set a password. In this case, you can use the `createRecovery` and `updateRecovery` methods to set a password. Otherwise, if the attribute is not null or empty, you can use the `updatePassword` method even if the user doesn't have a password yet. Simply pass anything for the password parameter.
For more information, refer to the links provided:
- Updating password: <https://app
WildAnimal
Rank 2: Process
Jul 13, 2023, 07:58
Supplement: The user has already logged in.
Drake
Jul 13, 2023, 16:26
determine whether to use the updatePassword or createRecovery and updateRecovery methods
You should be able to use updatePassword even if they don't have a password. you can pass anything for the password param.