1- // // Copyright 2020 The Gitea Authors. All rights reserved.
2- // // SPDX-License-Identifier: MIT
1+ // Copyright 2025 The Gitea Authors. All rights reserved.
2+ // SPDX-License-Identifier: MIT
33
44package convert
55
@@ -10,8 +10,7 @@ import (
1010 api "code.gitea.io/gitea/modules/structs"
1111)
1212
13- // ToUser convert user_model.User to api.User
14- // if doer is set, private information is added if the doer has the permission to see it
13+ // ToOauthProvider convert auth_model.Source≤ to api.AuthOauth2Option
1514func ToOauthProvider (ctx context.Context , provider * auth_model.Source ) * api.AuthOauth2Option {
1615 if provider == nil {
1716 return nil
@@ -20,7 +19,7 @@ func ToOauthProvider(ctx context.Context, provider *auth_model.Source) *api.Auth
2019 return toOauthProvider (provider )
2120}
2221
23- // ToUsers convert list of user_model.User to list of api.User
22+ // ToOauthProviders convert list of auth_model.Source to list of api.AuthOauth2Option
2423func ToOauthProviders (ctx context.Context , provider []* auth_model.Source ) []* api.AuthOauth2Option {
2524 result := make ([]* api.AuthOauth2Option , len (provider ))
2625 for i := range provider {
@@ -33,7 +32,6 @@ func toOauthProvider(provider *auth_model.Source) *api.AuthOauth2Option {
3332 return & api.AuthOauth2Option {
3433 ID : provider .ID ,
3534 AuthenticationName : provider .Name ,
36- Type : provider .Type .Int (),
3735 TypeName : provider .Type .String (),
3836
3937 IsActive : provider .IsActive ,
0 commit comments