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

Method RequestOneTimePasscode

codersdk/users.go:916–928  ·  view source on GitHub ↗
(ctx context.Context, req RequestOneTimePasscodeRequest)

Source from the content-addressed store, hash-verified

914}
915
916func (c *Client) RequestOneTimePasscode(ctx context.Context, req RequestOneTimePasscodeRequest) error {
917 res, err := c.Request(ctx, http.MethodPost, "/api/v2/users/otp/request", req)
918 if err != nil {
919 return err
920 }
921 defer res.Body.Close()
922
923 if res.StatusCode != http.StatusNoContent {
924 return ReadBodyAsError(res)
925 }
926
927 return nil
928}
929
930func (c *Client) ChangePasswordWithOneTimePasscode(ctx context.Context, req ChangePasswordWithOneTimePasscodeRequest) error {
931 res, err := c.Request(ctx, http.MethodPost, "/api/v2/users/otp/change-password", req)

Callers 1

TestUserForgotPasswordFunction · 0.80

Calls 3

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65

Tested by 1

TestUserForgotPasswordFunction · 0.64