mirror of
https://codeberg.org/pfzetto/axum-oidc
synced 2025-12-09 22:55:17 +01:00
fix: correct error handling in rp initiated logout
Previously the extractor would return `ExtractorError::Unauthorized` when the issuer does not provide a end_session_endpoint. Now it will return a `ExtractorError::RpInitiatedLogoutNotSupported`.
This commit is contained in:
parent
32ecc2041b
commit
202b61fa83
3 changed files with 15 additions and 10 deletions
|
|
@ -155,11 +155,14 @@ where
|
|||
type Rejection = ExtractorError;
|
||||
|
||||
async fn from_request_parts(parts: &mut Parts, _: &S) -> Result<Self, Self::Rejection> {
|
||||
parts
|
||||
match parts
|
||||
.extensions
|
||||
.get::<Self>()
|
||||
.get::<Option<Self>>()
|
||||
.cloned()
|
||||
.ok_or(ExtractorError::Unauthorized)
|
||||
.ok_or(ExtractorError::Unauthorized)?{
|
||||
Some(this) => Ok(this),
|
||||
None => Err(ExtractorError::RpInitiatedLogoutNotSupported),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue