⬆️ Upgrade passport to identity
This commit is contained in:
@ -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,
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user