🐛 Fix issue mismatch
All checks were successful
release-nightly / build-docker (push) Successful in 3m23s
All checks were successful
release-nightly / build-docker (push) Successful in 3m23s
This commit is contained in:
parent
359d3604d2
commit
c5126bc4db
@ -25,7 +25,7 @@ func EncodeJwt(id string, val any, typ, sub string, aud []string, exp time.Time)
|
|||||||
jwt.RegisteredClaims{
|
jwt.RegisteredClaims{
|
||||||
Subject: sub,
|
Subject: sub,
|
||||||
Audience: aud,
|
Audience: aud,
|
||||||
Issuer: viper.GetString("domain"),
|
Issuer: fmt.Sprintf("https://%s", viper.GetString("domain")),
|
||||||
ExpiresAt: jwt.NewNumericDate(exp),
|
ExpiresAt: jwt.NewNumericDate(exp),
|
||||||
NotBefore: jwt.NewNumericDate(time.Now()),
|
NotBefore: jwt.NewNumericDate(time.Now()),
|
||||||
IssuedAt: jwt.NewNumericDate(time.Now()),
|
IssuedAt: jwt.NewNumericDate(time.Now()),
|
||||||
|
@ -69,7 +69,7 @@ func doChallenge(c *fiber.Ctx) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return fiber.NewError(fiber.StatusBadRequest, err.Error())
|
return fiber.NewError(fiber.StatusBadRequest, err.Error())
|
||||||
} else if challenge.Progress >= challenge.Requirements {
|
} 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 {
|
if err != nil {
|
||||||
return fiber.NewError(fiber.StatusBadRequest, err.Error())
|
return fiber.NewError(fiber.StatusBadRequest, err.Error())
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ func doConnect(c *fiber.Ctx) error {
|
|||||||
user,
|
user,
|
||||||
client,
|
client,
|
||||||
strings.Split(scope, " "),
|
strings.Split(scope, " "),
|
||||||
[]string{"Hydrogen.Passport", client.Alias},
|
[]string{"passport", client.Alias},
|
||||||
nil,
|
nil,
|
||||||
lo.ToPtr(time.Now()),
|
lo.ToPtr(time.Now()),
|
||||||
c.IP(),
|
c.IP(),
|
||||||
@ -95,7 +95,7 @@ func doConnect(c *fiber.Ctx) error {
|
|||||||
user,
|
user,
|
||||||
client,
|
client,
|
||||||
strings.Split(scope, " "),
|
strings.Split(scope, " "),
|
||||||
[]string{"Hydrogen.Passport", client.Alias},
|
[]string{"passport", client.Alias},
|
||||||
nil,
|
nil,
|
||||||
lo.ToPtr(time.Now()),
|
lo.ToPtr(time.Now()),
|
||||||
c.IP(),
|
c.IP(),
|
||||||
|
@ -22,8 +22,8 @@ func NewServer() {
|
|||||||
A = fiber.New(fiber.Config{
|
A = fiber.New(fiber.Config{
|
||||||
DisableStartupMessage: true,
|
DisableStartupMessage: true,
|
||||||
EnableIPValidation: true,
|
EnableIPValidation: true,
|
||||||
ServerHeader: "Hydrogen.Passport",
|
ServerHeader: "passport",
|
||||||
AppName: "Hydrogen.Passport",
|
AppName: "passport",
|
||||||
JSONEncoder: jsoniter.ConfigCompatibleWithStandardLibrary.Marshal,
|
JSONEncoder: jsoniter.ConfigCompatibleWithStandardLibrary.Marshal,
|
||||||
JSONDecoder: jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal,
|
JSONDecoder: jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal,
|
||||||
EnablePrintRoutes: viper.GetBool("debug"),
|
EnablePrintRoutes: viper.GetBool("debug"),
|
||||||
|
Loading…
Reference in New Issue
Block a user