comAtprotoServerCreateSession function

Future<XRPCResponse<ServerCreateSessionOutput>> comAtprotoServerCreateSession({
  1. required String identifier,
  2. required String password,
  3. String? authFactorToken,
  4. bool? allowTakendown,
  5. required ServiceContext $ctx,
  6. Map<String, String>? $headers,
  7. Map<String, String>? $unknown,
})

Create an authentication session.

Implementation

Future<XRPCResponse<ServerCreateSessionOutput>> comAtprotoServerCreateSession({
  required String identifier,
  required String password,
  String? authFactorToken,
  bool? allowTakendown,
  required ServiceContext $ctx,
  Map<String, String>? $headers,
  Map<String, String>? $unknown,
}) async => await $ctx.post(
  ns.comAtprotoServerCreateSession,
  headers: {'Content-type': 'application/json', ...?$headers},
  body: {
    ...?$unknown,
    'identifier': identifier,
    'password': password,
    if (authFactorToken != null) 'authFactorToken': authFactorToken,
    if (allowTakendown != null) 'allowTakendown': allowTakendown,
  },
  to: const ServerCreateSessionOutputConverter().fromJson,
);