authenticateCustom method
Custom authentication
Nakama supports Custom Authentication methods to integrate with additional identity services.
Implementation
@override
Future<model.Session> authenticateCustom({
required String id,
bool create = true,
String? username,
Map<String, String>? vars,
}) async {
final res = await _api.v2AccountAuthenticateCustomPost(
body: ApiAccountCustom(id: id, vars: vars),
create: create,
username: username,
);
if (res.body == null) {
throw Exception('Authentication failed.');
}
final data = res.body!;
return model.Session.fromApi(data);
}