Session constructor

Session({
  1. required String token,
  2. required bool created,
  3. String? refreshToken,
})

Implementation

Session({
  required this.token,
  required this.created,
  this.refreshToken,
}) {
  final decodedToken = JwtDecoder.decode(token);

  userId = decodedToken['uid'];
  username = decodedToken['usn'];
  expiresAt = decodedToken['exp'];
}