sessionRefresh method

  1. @override
Future<Session> sessionRefresh({
  1. required Session session,
  2. Map<String, String>? vars,
})
override

Implementation

@override
Future<model.Session> sessionRefresh({
  required model.Session session,
  Map<String, String>? vars,
}) async {
  _session = session;

  final res = await _api.nakamaSessionRefresh(
      body:
          ApiSessionRefreshRequest(token: session.refreshToken, vars: vars));
  final data = res.body!;

  return model.Session(
    created: data.created ?? false,
    token: data.token!,
    refreshToken: data.refreshToken,
  );
}