Fix bearer prefix

This commit is contained in:
eraden 2023-08-15 17:51:26 +02:00
parent 13c64f58fd
commit 1c8a536f92
2 changed files with 4 additions and 1 deletions

View File

@ -202,6 +202,8 @@ impl Extractor {
.to_str() .to_str()
.map_err(|_| Error::NoAuthHeader)?; .map_err(|_| Error::NoAuthHeader)?;
let as_str = as_str.strip_prefix("Bearer ").or_else(|| as_str.strip_prefix("bearer ")).unwrap_or(as_str);
let decoded_claims = let decoded_claims =
decode::<ClaimsType>(as_str, &*jwt_decoding_key, &Validation::new(algorithm)).map_err( decode::<ClaimsType>(as_str, &*jwt_decoding_key, &Validation::new(algorithm)).map_err(
|_e| { |_e| {

View File

@ -2,7 +2,8 @@
<ul class="flex flex-col font-medium p-4 md:p-0 mt-4 border border-gray-100 rounded-lg bg-gray-50 md:flex-row md:space-x-8 md:mt-0 md:border-0 md:bg-white dark:bg-gray-800 md:dark:bg-gray-900 dark:border-gray-700"> <ul class="flex flex-col font-medium p-4 md:p-0 mt-4 border border-gray-100 rounded-lg bg-gray-50 md:flex-row md:space-x-8 md:mt-0 md:border-0 md:bg-white dark:bg-gray-800 md:dark:bg-gray-900 dark:border-gray-700">
<li> <li>
<a <a
href="#" href="/"
hx-get="/"
hx-replace-url="true" hx-replace-url="true"
class="block py-2 pl-3 pr-4 text-white bg-blue-700 rounded md:bg-transparent md:text-blue-700 md:p-0 md:dark:text-blue-500" class="block py-2 pl-3 pr-4 text-white bg-blue-700 rounded md:bg-transparent md:text-blue-700 md:p-0 md:dark:text-blue-500"
aria-current="page" aria-current="page"