app/controllers/users/sessions_controller.rb
# GET /user/token?referrer - link to sign_in user with token in params
GET /user/token?referrer - link to sign_in user with token in params
GET / user / token?referrer - link to sign_in user with token in params
def token
      user =
        Users::AuthenticationService.new(current_school, params[:token])
          .authenticate
      store_location_for(:user, params[:referrer]) if params[:referrer].present?
      if user.present?
        sign_in user
        remember_me(user) unless params[:shared_device] == 'true'
        Users::ConfirmationService.new(user).execute
        user.update!(account_deletion_notification_sent_at: nil)
        redirect_to after_sign_in_path_for(user)
      else
        flash[:error] =
          'That one-time link has expired, or is invalid. Please try signing in again.'
        redirect_to new_user_session_path
      end
    end
def token user = Users :: AuthenticationService . new ( current_school , params [ :token ] ) . authenticate store_location_for ( :user , params [ :referrer ] ) if params [ :referrer ] . present? if user . present? sign_in user remember_me ( user ) unless params [ :shared_device ] == 'true' Users :: ConfirmationService . new ( user ) . execute user . update! ( account_deletion_notification_sent_at : nil ) redirect_to after_sign_in_path_for ( user ) else flash [ :error ] = 'That one-time link has expired, or is invalid. Please try signing in again.' redirect_to new_user_session_path end end
GET /user/token?referrer - link to sign_in user with token in params
GET / user / token?referrer - link to sign_in user with token in params