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

Method UpdateUserHashedPassword

coderd/database/dbauthz/dbauthz.go:7471–7487  ·  view source on GitHub ↗
(ctx context.Context, arg database.UpdateUserHashedPasswordParams)

Source from the content-addressed store, hash-verified

7469}
7470
7471func (q *querier) UpdateUserHashedPassword(ctx context.Context, arg database.UpdateUserHashedPasswordParams) error {
7472 user, err := q.db.GetUserByID(ctx, arg.ID)
7473 if err != nil {
7474 return err
7475 }
7476
7477 err = q.authorizeContext(ctx, policy.ActionUpdatePersonal, user)
7478 if err != nil {
7479 // Admins can update passwords for other users.
7480 err = q.authorizeContext(ctx, policy.ActionUpdate, user)
7481 if err != nil {
7482 return err
7483 }
7484 }
7485
7486 return q.db.UpdateUserHashedPassword(ctx, arg)
7487}
7488
7489func (q *querier) UpdateUserLastSeenAt(ctx context.Context, arg database.UpdateUserLastSeenAtParams) (database.User, error) {
7490 fetch := func(ctx context.Context, arg database.UpdateUserLastSeenAtParams) (database.User, error) {

Callers

nothing calls this directly

Calls 3

authorizeContextMethod · 0.95
GetUserByIDMethod · 0.65

Tested by

no test coverage detected