🐛 Fix issue mismatch
All checks were successful
release-nightly / build-docker (push) Successful in 3m23s

This commit is contained in:
LittleSheep 2024-01-30 21:24:54 +08:00
parent 359d3604d2
commit c5126bc4db
4 changed files with 6 additions and 6 deletions

View File

@ -25,7 +25,7 @@ func EncodeJwt(id string, val any, typ, sub string, aud []string, exp time.Time)
jwt.RegisteredClaims{
Subject: sub,
Audience: aud,
Issuer: viper.GetString("domain"),
Issuer: fmt.Sprintf("https://%s", viper.GetString("domain")),
ExpiresAt: jwt.NewNumericDate(exp),
NotBefore: jwt.NewNumericDate(time.Now()),
IssuedAt: jwt.NewNumericDate(time.Now()),

View File

@ -69,7 +69,7 @@ func doChallenge(c *fiber.Ctx) error {
if err != nil {
return fiber.NewError(fiber.StatusBadRequest, err.Error())
} else if challenge.Progress >= challenge.Requirements {
session, err := security.GrantSession(challenge, []string{"*"}, []string{"Hydrogen.Passport"}, nil, lo.ToPtr(time.Now()))
session, err := security.GrantSession(challenge, []string{"*"}, []string{"passport"}, nil, lo.ToPtr(time.Now()))
if err != nil {
return fiber.NewError(fiber.StatusBadRequest, err.Error())
}

View File

@ -73,7 +73,7 @@ func doConnect(c *fiber.Ctx) error {
user,
client,
strings.Split(scope, " "),
[]string{"Hydrogen.Passport", client.Alias},
[]string{"passport", client.Alias},
nil,
lo.ToPtr(time.Now()),
c.IP(),
@ -95,7 +95,7 @@ func doConnect(c *fiber.Ctx) error {
user,
client,
strings.Split(scope, " "),
[]string{"Hydrogen.Passport", client.Alias},
[]string{"passport", client.Alias},
nil,
lo.ToPtr(time.Now()),
c.IP(),

View File

@ -22,8 +22,8 @@ func NewServer() {
A = fiber.New(fiber.Config{
DisableStartupMessage: true,
EnableIPValidation: true,
ServerHeader: "Hydrogen.Passport",
AppName: "Hydrogen.Passport",
ServerHeader: "passport",
AppName: "passport",
JSONEncoder: jsoniter.ConfigCompatibleWithStandardLibrary.Marshal,
JSONDecoder: jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal,
EnablePrintRoutes: viper.GetBool("debug"),