function completeLogin
completeLogin(request: FederationSessionRequest): Promise<User>

Finishes a sign-in begun by startLogin, for POST /api/federation/sessions, and returns the account it signs in to: the one linked to the identity, brought up to date, or a new one. A login works once. A new account needs the home to be trusted, or the invite the login was started with, claimed now.

Parameters

Return Type

Promise<User>

Throws

APIException

400 when the login is unknown or expired; 401 when the identity token doesn't verify; 403 when sign-ins from other instances are off, or the account may not be created; 409 when its handle is someone's; 502 when the home fails.

Usage

import { completeLogin } from "api/services/federation-service.ts";