AngelAuth<User> constructor
AngelAuth<User> ({
- String? jwtKey,
- required FutureOr<
String> serializer(- User
- required FutureOr<
User> deserializer(), - num jwtLifeSpan = -1,
- bool allowCookie = true,
- bool allowTokenInQuery = true,
- bool enforceIp = true,
- String? cookieDomain,
- String cookiePath = '/',
- bool secureCookies = true,
- 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();
}