// // Copyright (C) 2024 veypi // 2025-03-04 16:08:06 // Distributed under terms of the MIT license. // package providers import ( "github.com/veypi/vbase/models" "github.com/veypi/vigo" ) // TemplatesResponse 模板响应 type TemplatesResponse struct { Templates []models.OAuthProvider `json:"templates"` } // templates 获取内置 OAuth 模板 func templates(x *vigo.X) (*TemplatesResponse, error) { // 返回内置模板(清除敏感信息) templates := make([]models.OAuthProvider, len(models.OAuthProviderTemplates)) for i, tpl := range models.OAuthProviderTemplates { templates[i] = tpl templates[i].ClientID = "" templates[i].ClientSecret = "" } return &TemplatesResponse{ Templates: templates, }, nil }