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

Commit60fc32c

Browse files
fix: appease linter
1 parentb44adff commit60fc32c

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

‎coderd/database/dbmem/dbmem.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9077,7 +9077,7 @@ func (q *FakeQuerier) UpdateUserGithubComUserID(_ context.Context, arg database.
90779077
returnsql.ErrNoRows
90789078
}
90799079

9080-
func (q*FakeQuerier)UpdateUserHashedOneTimePasscode(ctx context.Context,arg database.UpdateUserHashedOneTimePasscodeParams)error {
9080+
func (q*FakeQuerier)UpdateUserHashedOneTimePasscode(_ context.Context,arg database.UpdateUserHashedOneTimePasscodeParams)error {
90819081
err:=validateDatabaseType(arg)
90829082
iferr!=nil {
90839083
returnerr

‎coderd/userauth.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,11 +281,15 @@ func (api *API) postRequestOneTimePasscode(rw http.ResponseWriter, r *http.Reque
281281
aReq.New=newUser
282282

283283
// Send the one-time-passcode to the user.
284-
api.notifyUserRequestedOneTimePasscode(ctx,user,passcode.String())
284+
err=api.notifyUserRequestedOneTimePasscode(ctx,user,passcode.String())
285+
iferr!=nil {
286+
logger.Error(ctx,"unable to notify user about one time passcode request",slog.Error(err))
287+
}
285288
}
286289

287-
func (api*API)notifyUserRequestedOneTimePasscode(ctx context.Context,user database.User,passcodestring) {
290+
func (api*API)notifyUserRequestedOneTimePasscode(ctx context.Context,user database.User,passcodestring)error{
288291
_,err:=api.NotificationsEnqueuer.Enqueue(
292+
//nolint:gocritic // We need to be able to send the user their one time passcode.
289293
dbauthz.AsSystemRestricted(ctx),
290294
user.ID,
291295
notifications.TemplateUserRequestedOneTimePasscode,
@@ -294,8 +298,10 @@ func (api *API) notifyUserRequestedOneTimePasscode(ctx context.Context, user dat
294298
user.ID,
295299
)
296300
iferr!=nil {
297-
api.Logger.Warn(ctx,"unable to notify user about requested one-time-passcode",slog.F("affected_user",user.Username),slog.Error(err))
301+
returnxerrors.Errorf("enqueue notification: %w",err)
298302
}
303+
304+
returnnil
299305
}
300306

301307
// Change a users password with a one-time-passcode.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp