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

Commitd7ba6c0

Browse files
committed
fix IsGithubDotComURL check
1 parentd8d4b9b commitd7ba6c0

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