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

auth のすべて #90

Merged
merged 7 commits into from
Jan 25, 2025
Merged

auth のすべて #90

merged 7 commits into from
Jan 25, 2025

Conversation

SSlime-s
Copy link
Contributor

No description provided.

@SSlime-s SSlime-s requested a review from H1rono January 25, 2025 07:20
@SSlime-s SSlime-s self-assigned this Jan 25, 2025
Comment on lines 101 to 110
let code = req_
.uri()
.query()
.ok_or(super::Error::InvalidRequest("missing query".to_string()))?
.split('&')
.find(|s| s.starts_with("code="))
.ok_or(super::Error::InvalidRequest("missing code".to_string()))?
.split('=')
.nth(1)
.ok_or(super::Error::InvalidRequest("missing code".to_string()))?;
Copy link
Member

Choose a reason for hiding this comment

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

ここ絶対まずいのでaxum::extract::Query使いましょう

https://docs.rs/axum/latest/axum/extract/struct.Query.html

Copy link
Contributor Author

Choose a reason for hiding this comment

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

探してた~

let pool = ctx.as_ref();
let traq_host: &crate::traq::TraqHost = ctx.as_ref();

oauth2_handle_redirect(client, req_client.clone(), req, ctx, pool, &traq_host.0).boxed()
Copy link
Member

Choose a reason for hiding this comment

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

req_clientclone必要なくないですか

Copy link
Member

@H1rono H1rono left a comment

Choose a reason for hiding this comment

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

LGTM

@H1rono H1rono merged commit 16910ef into main Jan 25, 2025
4 checks passed
@H1rono H1rono deleted the SSlime/impl-auth branch January 25, 2025 07:58
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