Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0a1a44a

Browse files
committed
Pass the whole app to db2sdk
1 parent 8cc7965 commit 0a1a44a

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

enterprise/coderd/oauth2.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,11 @@ func (api *API) oAuth2ProviderApps(rw http.ResponseWriter, r *http.Request) {
7979
return
8080
}
8181

82-
var dbApps []database.OAuth2ProviderApp
82+
var sdkApps []codersdk.OAuth2ProviderApp
8383
for _, app := range userApps {
84-
dbApps = append(dbApps, database.OAuth2ProviderApp{
85-
ID: app.OAuth2ProviderApp.ID,
86-
Name: app.OAuth2ProviderApp.Name,
87-
CallbackURL: app.OAuth2ProviderApp.CallbackURL,
88-
Icon: app.OAuth2ProviderApp.Icon,
89-
})
84+
sdkApps = append(sdkApps, db2sdk.OAuth2ProviderApp(api.AccessURL, app.OAuth2ProviderApp))
9085
}
91-
httpapi.Write(ctx, rw, http.StatusOK, db2sdk.OAuth2ProviderApps(api.AccessURL, dbApps))
86+
httpapi.Write(ctx, rw, http.StatusOK, sdkApps)
9287
}
9388

9489
// @Summary Get OAuth2 application.

0 commit comments

Comments
 (0)