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
|
|
@ -11,11 +11,12 @@ pub enum ExtractorError {
|
|||
#[error("unauthorized")]
|
||||
Unauthorized,
|
||||
|
||||
#[error("rp initiated logout information not found")]
|
||||
RpInitiatedLogoutInformationNotFound,
|
||||
#[error("rp initiated logout not supported by issuer")]
|
||||
RpInitiatedLogoutNotSupported,
|
||||
|
||||
#[error("could not build rp initiated logout uri")]
|
||||
FailedToCreateRpInitiatedLogoutUri,
|
||||
|
||||
}
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
|
|
@ -88,7 +89,7 @@ impl IntoResponse for ExtractorError {
|
|||
fn into_response(self) -> axum_core::response::Response {
|
||||
match self {
|
||||
Self::Unauthorized => (StatusCode::UNAUTHORIZED, "unauthorized").into_response(),
|
||||
Self::RpInitiatedLogoutInformationNotFound => {
|
||||
Self::RpInitiatedLogoutNotSupported => {
|
||||
(StatusCode::INTERNAL_SERVER_ERROR, "intenal server error").into_response()
|
||||
}
|
||||
Self::FailedToCreateRpInitiatedLogoutUri => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue