mirror of
https://github.com/mastodon/mastodon.git
synced 2025-01-17 15:47:15 +01:00
52b55dabbb
This is lacking tests (and proper icons), but can talk to a debug provider.
27 lines
663 B
Ruby
27 lines
663 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Api::Fasp::RegistrationsController < Api::Fasp::BaseController
|
|
skip_before_action :require_authentication
|
|
|
|
def create
|
|
@current_provider = Fasp::Provider.create!(
|
|
name: params[:name],
|
|
base_url: params[:baseUrl],
|
|
remote_identifier: params[:serverId],
|
|
provider_public_key_base64: params[:publicKey]
|
|
)
|
|
|
|
render json: registration_confirmation
|
|
end
|
|
|
|
private
|
|
|
|
def registration_confirmation
|
|
{
|
|
faspId: current_provider.id.to_s,
|
|
publicKey: current_provider.server_public_key_base64,
|
|
registrationCompletionUri: admin_fasp_provider_url(current_provider),
|
|
}
|
|
end
|
|
end
|