AngelAuth<User> constructor

AngelAuth<User>({
  1. String? jwtKey,
  2. required FutureOr<String> serializer(
    1. User
    ),
  3. required FutureOr<User> deserializer(
    1. String
    ),
  4. num jwtLifeSpan = -1,
  5. bool allowCookie = true,
  6. bool allowTokenInQuery = true,
  7. bool enforceIp = true,
  8. String? cookieDomain,
  9. String cookiePath = '/',
  10. bool secureCookies = true,
  11. String reviveTokenEndpoint = '/auth/token',
})

jwtLifeSpan - should be in milliseconds.

Implementation

AngelAuth(
    {String? jwtKey,
    required this.serializer,
    required this.deserializer,
    num jwtLifeSpan = -1,
    this.allowCookie = true,
    this.allowTokenInQuery = true,
    this.enforceIp = true,
    this.cookieDomain,
    this.cookiePath = '/',
    this.secureCookies = true,
    this.reviveTokenEndpoint = '/auth/token'})
    : super() {
  _hs256 = Hmac(sha256, (jwtKey ?? _randomString()).codeUnits);
  _jwtLifeSpan = jwtLifeSpan.toInt();
}