authenticateFacebook method
Future<Session>
authenticateFacebook({
- required String token,
- bool create = true,
- String? username,
- Map<
String, String> ? vars, - bool import = false,
override
Implementation
@override
Future<model.Session> authenticateFacebook({
required String token,
bool create = true,
String? username,
Map<String, String>? vars,
bool import = false,
}) async {
final res = await _api.nakamaAuthenticateFacebook(
body: ApiAccountFacebook(
token: token,
vars: vars,
),
$sync: import,
create: create,
username: username,
);
if (res.body == null) {
throw Exception('Authentication failed.');
}
final data = res.body!;
return model.Session(
created: data.created ?? false,
token: data.token!,
refreshToken: data.refreshToken,
);
}