check static method

Future<bool> check(
  1. HttpRequest request
)

Determines whether the request is currently authenticated.

This is a convenience wrapper around user.

Returns true when a valid authenticated user can be resolved; otherwise returns false.

Example:

if (await AuthSession.check(request)) {
  print('User is authenticated');
} else {
  print('Guest request');
}

Implementation

static Future<bool> check(HttpRequest request) async {
  return await user(request) != null;
}