Files
fizzy/app/controllers/sessions/starts_controller.rb
T
2025-10-31 16:26:08 +01:00

23 lines
587 B
Ruby

class Sessions::StartsController < ApplicationController
allow_unauthenticated_access
require_identified_access
layout "public"
def new
end
def create
email_address = IdentityProvider.resolve_token(resume_identity)
user = User.find_by(email_address: email_address)
if user
start_new_session_for(user)
redirect_to after_authentication_url
else
IdentityProvider.unlink(email_address: email_address, from: ApplicationRecord.current_tenant)
redirect_to session_login_menu_path, alert: "You can't access this account"
end
end
end