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

Commitf6bed73

Browse files
committed
Fix updating to when the token changes
1 parentf9214ed commitf6bed73

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

‎coderd/externalauth/externalauth.go‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -189,19 +189,19 @@ validate:
189189
returnupdatedAuthLink,xerrors.Errorf("update external auth link: %w",err)
190190
}
191191
externalAuthLink=updatedAuthLink
192-
}
193192

194-
// Update the associated users github.com username if the token is for github.com.
195-
ifIsGithubDotComURL(c.AuthCodeURL(""))&&user!=nil {
196-
err=db.UpdateUserGithubComUserID(ctx, database.UpdateUserGithubComUserIDParams{
197-
ID:externalAuthLink.UserID,
198-
GithubComUserID: sql.NullInt64{
199-
Int64:user.ID,
200-
Valid:true,
201-
},
202-
})
203-
iferr!=nil {
204-
returnexternalAuthLink,xerrors.Errorf("update user github com user id: %w",err)
193+
// Update the associated users github.com username if the token is for github.com.
194+
ifIsGithubDotComURL(c.AuthCodeURL(""))&&user!=nil {
195+
err=db.UpdateUserGithubComUserID(ctx, database.UpdateUserGithubComUserIDParams{
196+
ID:externalAuthLink.UserID,
197+
GithubComUserID: sql.NullInt64{
198+
Int64:user.ID,
199+
Valid:true,
200+
},
201+
})
202+
iferr!=nil {
203+
returnexternalAuthLink,xerrors.Errorf("update user github com user id: %w",err)
204+
}
205205
}
206206
}
207207

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp