⬆️ Upgrade passport to identity

This commit is contained in:
2024-02-18 22:41:18 +08:00
parent 9986fb0b9c
commit 7cecb8f8f7
7 changed files with 16 additions and 16 deletions

View File

@ -33,10 +33,10 @@ func GetAccountFollowed(user models.Account, target models.Account) (models.Acco
}
func NotifyAccount(user models.Account, subject, content string, links ...fiber.Map) error {
agent := fiber.Post(viper.GetString("passport.endpoint") + "/api/dev/notify")
agent := fiber.Post(viper.GetString("identity.endpoint") + "/api/dev/notify")
agent.JSON(fiber.Map{
"client_id": viper.GetString("passport.client_id"),
"client_secret": viper.GetString("passport.client_secret"),
"client_id": viper.GetString("identity.client_id"),
"client_secret": viper.GetString("identity.client_secret"),
"subject": subject,
"content": content,
"links": links,

View File

@ -12,7 +12,7 @@ import (
"time"
)
type PassportUserinfo struct {
type IdentityUserinfo struct {
Sub string `json:"sub"`
Name string `json:"name"`
Email string `json:"email"`
@ -20,7 +20,7 @@ type PassportUserinfo struct {
PreferredUsername string `json:"preferred_username"`
}
func LinkAccount(userinfo PassportUserinfo) (models.Account, error) {
func LinkAccount(userinfo IdentityUserinfo) (models.Account, error) {
id, _ := strconv.Atoi(userinfo.Sub)
var account models.Account