-
Notifications
You must be signed in to change notification settings - Fork 231
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation
Description
Configuration
- Sorcery Version: latest
Expected Behavior
The docs should be clear and not say two different things in two places.
Actual Behavior
The README recommends the following steps to activate a user:
User.load_from_activation_token(token)
@user.setup_activation
@user.activate!
This suggests that a call to setup_activation
is required to activate a user. In the Wiki, however, setup_activation
is omitted (and only mentioned at the very bottom in an example for resending the activation email):
if @user = User.load_from_activation_token(params[:id])
@user.activate!
redirect_to(login_path, :notice => 'User was successfully activated.')
Source for setup_activation
at the time of writing:
sorcery/lib/sorcery/model/submodules/user_activation.rb
Lines 90 to 96 in 6fdc703
def setup_activation | |
config = sorcery_config | |
generated_activation_token = TemporaryToken.generate_random_token | |
send(:"#{config.activation_token_attribute_name}=", generated_activation_token) | |
send(:"#{config.activation_state_attribute_name}=", 'pending') | |
send(:"#{config.activation_token_expires_at_attribute_name}=", Time.now.in_time_zone + config.activation_token_expiration_period) if config.activation_token_expiration_period | |
end |
Desired changes
- clarify in the docs when a call to
setup_activation
is needed - harmonize the examples in the README and the Wiki so no confusion about when it's required to call
setup_activation
.
Steps to Reproduce
Doesn't apply.
andreimoment and joshbuker
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation