d5a4239d19
to be more generic for the open-source release. Find the signal account via Account#external_account Find the signal user via User#external_user
24 lines
535 B
Ruby
24 lines
535 B
Ruby
class Sessions::LaunchpadController < ApplicationController
|
|
require_unauthenticated_access
|
|
|
|
before_action :require_sig
|
|
|
|
def show
|
|
end
|
|
|
|
def update
|
|
user = Account.sole.external_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
|