checkAuth method
Implementation
FutureOr<Message> checkAuth(Request request) {
if ((authRequired && request.context.accessToken != null) ||
(!authRequired && request.context.accessToken == null)) {
return request;
} else {
throw UnauthorizedException();
}
}