refactor: rename ExternalInfo to ExternalUser and update related functions for consistency

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
mlogclub
2026-04-28 11:10:47 +08:00
parent 0ad2ef83df
commit cf63b75590
15 changed files with 81 additions and 111 deletions
+3 -3
View File
@@ -9,7 +9,7 @@ import (
"github.com/mlogclub/simple/web"
)
func ExternalInfoMiddleware(ctx iris.Context) {
func ExternalUserMiddleware(ctx iris.Context) {
channel := services.ChannelService.GetEnabledChannel(ctx)
if channel == nil {
ctx.StopExecution()
@@ -17,12 +17,12 @@ func ExternalInfoMiddleware(ctx iris.Context) {
return
}
secret := services.ChannelService.GetUserTokenSecret(channel)
ext, err := openidentity.GetExternalInfo(ctx, secret)
ext, err := openidentity.GetExternalUser(ctx, secret)
if err != nil {
ctx.StopExecution()
_ = ctx.JSON(web.JsonError(err))
return
}
irisx.SetExternalInfo(ctx, ext)
irisx.SetExternalUser(ctx, ext)
ctx.Next()
}