getBearerToken method

String? getBearerToken()

Get the bearer token from the request headers.

Implementation

String? getBearerToken() {
  if (this.containsKey("Authorization")) {
    String? auth = this["Authorization"];
    if (auth != null) {
      return auth.replaceFirst("Bearer ", "");
    }
  }
  return null;
}