MCPcopy Index your code
hub / github.com/coder/coder / notifyUserRequestedOneTimePasscode

Method notifyUserRequestedOneTimePasscode

coderd/userauth.go:310–325  ·  view source on GitHub ↗
(ctx context.Context, user database.User, passcode string)

Source from the content-addressed store, hash-verified

308}
309
310func (api *API) notifyUserRequestedOneTimePasscode(ctx context.Context, user database.User, passcode string) error {
311 _, err := api.NotificationsEnqueuer.Enqueue(
312 //nolint:gocritic // We need the notifier auth context to be able to send the user their one-time passcode.
313 dbauthz.AsNotifier(ctx),
314 user.ID,
315 notifications.TemplateUserRequestedOneTimePasscode,
316 map[string]string{"one_time_passcode": passcode},
317 "change-password-with-one-time-passcode",
318 user.ID,
319 )
320 if err != nil {
321 return xerrors.Errorf("enqueue notification: %w", err)
322 }
323
324 return nil
325}
326
327// Change a users password with a one-time passcode.
328//

Callers 1

Calls 3

AsNotifierFunction · 0.92
EnqueueMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected