Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow response_mode to be null and if so do not add the query param #3700

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MatMaul
Copy link
Contributor

@MatMaul MatMaul commented Dec 17, 2024

No description provided.

@MatMaul MatMaul force-pushed the response-mode-default branch from fdd796d to 8c59ebe Compare December 17, 2024 10:59
Copy link
Member

@sandhose sandhose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few style points, otherwise looks good!

@@ -235,13 +235,17 @@ pub async fn config_sync(
}
};

let response_mode = match provider.response_mode {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using provider.response_mode.map(…) would help simplify this

mode => Ok(mode),
}
} else {
Ok(M::Fragment)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unclear to me why this has to change? This code is for the client -> MAS login part, and it is spec-compliant, nothing to do with the upstream provider stuff

Comment on lines +227 to +228
method => {
return Err(RouteError::InvalidReqMethod { method });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should never happen, the route is installed as POST and GET handler anyway

let html = templates.render_form_post(&context)?;
return Ok(Html(html).into_response());
}
match method {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm finding the old single match on the tuple easier to read. Could you go back to using that?

@@ -0,0 +1 @@
ALTER TABLE "upstream_oauth_providers" ALTER COLUMN "response_mode" DROP NOT NULL;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add the copyright header + a short description of what this migration does?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants