18 lines
307 B
Go
18 lines
307 B
Go
package utils
|
|
|
|
import (
|
|
"context"
|
|
|
|
"git.nobla.cn/golang/aeus-admin/types"
|
|
"git.nobla.cn/golang/aeus/middleware/auth"
|
|
)
|
|
|
|
func GetDomainFromContext(ctx context.Context) string {
|
|
if claims, ok := auth.FromContext(ctx); ok {
|
|
if v, ok := claims.(*types.Claims); ok {
|
|
return v.Domain
|
|
}
|
|
}
|
|
return ""
|
|
}
|