Skip to content

Commit a258f68

Browse files
refactor: request one-time passcode -> request password reset
1 parent 383581b commit a258f68

13 files changed

+48
-48
lines changed

coderd/apidoc/docs.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/audit.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,9 @@ func auditLogDescription(alog database.GetAuditLogsOffsetRow) string {
277277

278278
// NOTE: WriteString always returns a nil error, so we never check it
279279

280-
// Requesting a one-time passcode can be performed by anyone that knows the email
280+
// Requesting a password reset can be performed by anyone that knows the email
281281
// of a user so saying the user performed this action might be slightly misleading.
282-
if alog.AuditLog.Action != database.AuditActionRequestOneTimePasscode {
282+
if alog.AuditLog.Action != database.AuditActionRequestPasswordReset {
283283
_, _ = b.WriteString("{user} ")
284284
}
285285

@@ -305,7 +305,7 @@ func auditLogDescription(alog database.GetAuditLogsOffsetRow) string {
305305
return b.String()
306306
}
307307

308-
if alog.AuditLog.Action == database.AuditActionRequestOneTimePasscode {
308+
if alog.AuditLog.Action == database.AuditActionRequestPasswordReset {
309309
_, _ = b.WriteString(" for")
310310
} else {
311311
_, _ = b.WriteString(" ")

coderd/database/dump.sql

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/migrations/000268_add_audit_action_forgot_password.up.sql

-2
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ALTER TYPE audit_action
2+
ADD VALUE IF NOT EXISTS 'request_password_reset';

coderd/database/models.go

+11-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/userauth.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ func (api *API) postRequestOneTimePasscode(rw http.ResponseWriter, r *http.Reque
220220
Audit: *auditor,
221221
Log: api.Logger,
222222
Request: r,
223-
Action: database.AuditActionRequestOneTimePasscode,
223+
Action: database.AuditActionRequestPasswordReset,
224224
})
225225
)
226226
defer commitAudit()

codersdk/audit.go

+11-11
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ func (r ResourceType) FriendlyString() string {
8686
type AuditAction string
8787

8888
const (
89-
AuditActionCreate AuditAction = "create"
90-
AuditActionWrite AuditAction = "write"
91-
AuditActionDelete AuditAction = "delete"
92-
AuditActionStart AuditAction = "start"
93-
AuditActionStop AuditAction = "stop"
94-
AuditActionLogin AuditAction = "login"
95-
AuditActionLogout AuditAction = "logout"
96-
AuditActionRegister AuditAction = "register"
97-
AuditActionRequestOneTimePasscode AuditAction = "request_one_time_passcode"
89+
AuditActionCreate AuditAction = "create"
90+
AuditActionWrite AuditAction = "write"
91+
AuditActionDelete AuditAction = "delete"
92+
AuditActionStart AuditAction = "start"
93+
AuditActionStop AuditAction = "stop"
94+
AuditActionLogin AuditAction = "login"
95+
AuditActionLogout AuditAction = "logout"
96+
AuditActionRegister AuditAction = "register"
97+
AuditActionRequestPasswordReset AuditAction = "request_password_reset"
9898
)
9999

100100
func (a AuditAction) Friendly() string {
@@ -115,8 +115,8 @@ func (a AuditAction) Friendly() string {
115115
return "logged out"
116116
case AuditActionRegister:
117117
return "registered"
118-
case AuditActionRequestOneTimePasscode:
119-
return "one time passcode requested"
118+
case AuditActionRequestPasswordReset:
119+
return "password reset requested"
120120
default:
121121
return "unknown"
122122
}

docs/reference/api/schemas.md

+11-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/src/api/typesGenerated.ts

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/src/testHelpers/entities.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2604,8 +2604,8 @@ export const MockAuditLogRequestOneTimePasscode: TypesGen.AuditLog = {
26042604
...MockAuditLog,
26052605
resource_type: "user",
26062606
resource_target: "member",
2607-
action: "request_one_time_passcode",
2608-
description: "one time passcode requested for {target}",
2607+
action: "request_password_reset",
2608+
description: "password reset requested for {target}",
26092609
diff: {
26102610
hashed_password: {
26112611
old: "",

0 commit comments

Comments
 (0)