WealthFit.Campaigns.Shared.ActivateAccount (Peacemaker v3.3.5-rc.7) View Source
The main interface for ensuring accounts are properly set up given a token that was previously generated using an Peacemaker.UserProfile struct.
This module only works if the given JWT contains a type of set_initial_password_type.
To look more into how the JWTs are created, checkout Peacemaker.Authentication.generate_shortlink_token/2
The general intent here is that we need to ensure that the given token maps to a valid JWT in our database is set prior to setting the initial password (for security purposes). Thus, we perform all the necessary steps to setup the account here, but there is this assumption that the caller of this module should also ensure that the HTTP-only cookie is set.
We are also building this module with the intention of allowing users to choose a free class to watch when signing up, so a class_prismic_id is also accepted.
Important things to note here:
This process does not allow the user to set a password. For more information on how to set passwords for users, checkout WealthFit.Authentication.SetInitialPassword