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

Commit71a647b

Browse files
authored
feat: support ConvertUserLoginType for another user in codersdk(#17784)
Added `ConvertUserLoginType(ctx, user, req)` method to supportconverting the login type for a specified user.
1 parentd63417b commit71a647b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

‎codersdk/users.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,14 @@ func (c *Client) ChangePasswordWithOneTimePasscode(ctx context.Context, req Chan
663663
// based authentication to oauth based. The response has the oauth state code
664664
// to use in the oauth flow.
665665
func (c*Client)ConvertLoginType(ctx context.Context,reqConvertLoginRequest) (OAuthConversionResponse,error) {
666-
res,err:=c.Request(ctx,http.MethodPost,"/api/v2/users/me/convert-login",req)
666+
returnc.ConvertUserLoginType(ctx,Me,req)
667+
}
668+
669+
// ConvertUserLoginType will send a request to convert the user from password
670+
// based authentication to oauth based. The response has the oauth state code
671+
// to use in the oauth flow.
672+
func (c*Client)ConvertUserLoginType(ctx context.Context,userstring,reqConvertLoginRequest) (OAuthConversionResponse,error) {
673+
res,err:=c.Request(ctx,http.MethodPost,fmt.Sprintf("/api/v2/users/%s/convert-login",user),req)
667674
iferr!=nil {
668675
returnOAuthConversionResponse{},err
669676
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp