forked from External/greenlight
GRN2-233: Made account activation & password reset links based on tokens only (#959)
* GRN2-233: Hiding email in verification link and password reset link * updating tests * removing uid from email verificaiton link * GRN2-233: modifying test cases * GRN2-233: Removing uid from password reset link * GRN2-233: Removed email_params and fixed "authenticated?" method * GRN2-233: Fixed error when trying to sign in unverified * GRN2-233: Changed how activation tokens are generated
This commit is contained in:
@ -88,7 +88,10 @@ class SessionsController < ApplicationController
|
||||
# Check that the user is a Greenlight account
|
||||
return redirect_to(root_path, alert: I18n.t("invalid_login_method")) unless user.greenlight_account?
|
||||
# Check that the user has verified their account
|
||||
return redirect_to(account_activation_path(email: user.email)) unless user.activated?
|
||||
unless user.activated?
|
||||
user.create_activation_token
|
||||
return redirect_to(account_activation_path(token: user.activation_token))
|
||||
end
|
||||
end
|
||||
|
||||
login(user)
|
||||
|
Reference in New Issue
Block a user