- token = UserToken.find_by(:token => params[:confirm_string])
- if token&.user&.active?
- flash[:error] = t("confirmations.confirm.already active")
- redirect_to login_path
- elsif !token || token.expired?
- flash[:error] = t("confirmations.confirm.unknown token")
+ user = User.find_by_token_for(:new_user, params[:confirm_string])
+
+ if !user
+ flash[:error] = t(".unknown token")