Files
fizzy/app/controllers/sessions/launchpad_controller.rb
T
Mike Dalessio 8e13ce5b78 Drop Current.account and just use Account.sole
I had reintroduced this in dacb53b8 after David removed it in
6bbf68a4, but now I agree we don't need it.

Also, fix a CORS error when trying to redirect a user to an untenanted
path after login (see
https://fizzy.37signals.com/5986089/collections/2/cards/1032).
2025-07-20 13:00:09 -04:00

24 lines
533 B
Ruby

class Sessions::LaunchpadController < ApplicationController
require_unauthenticated_access
before_action :require_sig
def show
end
def update
user = Account.sole.signal_account.authenticate(sig: @sig).try(:peer)
if user.present? && user.active?
start_new_session_for user
redirect_to after_authentication_url
else
render plain: "Authentication failed. This is probably a bug.", status: :unauthorized
end
end
private
def require_sig
@sig = params.expect(:sig)
end
end