authenticate method

  1. @override
Future<void> authenticate(
  1. StrategyRequest request
)
override

Authenticate the request

Implementation

@override
Future<void> authenticate(StrategyRequest request) async {
  try {
    final jwtString = options.jwtFromRequest(request);
    if (jwtString == null) {
      return done(null);
    }
    final jwt = JWT.verify(jwtString, options.secret,
        checkNotBefore: options.checkNotBefore,
        checkExpiresIn: options.checkExpiresIn,
        checkHeaderType: options.checkHeaderType,
        issuer: options.issuer,
        subject: options.subject,
        audience: options.audience,
        jwtId: options.jwtId,
        issueAt: options.issueAt);
    callback.call(options, jwt, done);
  } catch (e) {
    done(e);
  }
}