Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8d5e6f3

Browse files
authored
fix: fix IsGithubDotComURL check (#17022)
When DeviceFlow with GitHub OAuth2 is configured, the`api.GithubOAuth2Config.AuthCode` is[overridden](https://github.com/coder/coder/blob/b08c8c9e1ee8edf18e9ba575098d99533062a240/coderd/userauth.go#L779)and returns a value that doesn't pass the `IsGithubDotComURL` check.This PR ensures the original `AuthCodeURL` method is used instead.
1 parent7d60186 commit8d5e6f3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎coderd/userauth.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,10 @@ func (api *API) userOAuth2Github(rw http.ResponseWriter, r *http.Request) {
10961096
}
10971097
// If the user is logging in with github.com we update their associated
10981098
// GitHub user ID to the new one.
1099-
ifexternalauth.IsGithubDotComURL(api.GithubOAuth2Config.AuthCodeURL(""))&&user.GithubComUserID.Int64!=ghUser.GetID() {
1099+
// We use AuthCodeURL from the OAuth2Config field instead of the one on
1100+
// GithubOAuth2Config because when device flow is configured, AuthCodeURL
1101+
// is overridden and returns a value that doesn't pass the URL check.
1102+
ifexternalauth.IsGithubDotComURL(api.GithubOAuth2Config.OAuth2Config.AuthCodeURL(""))&&user.GithubComUserID.Int64!=ghUser.GetID() {
11001103
err=api.Database.UpdateUserGithubComUserID(ctx, database.UpdateUserGithubComUserIDParams{
11011104
ID:user.ID,
11021105
GithubComUserID: sql.NullInt64{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp