feat: add features
This commit is contained in:
@@ -69,8 +69,8 @@ func (f *Middlewares) SilentAuth(c fiber.Ctx) error {
|
||||
return errors.Wrap(err, "failed to get user")
|
||||
}
|
||||
|
||||
c.SetUserContext(context.WithValue(c.UserContext(), consts.JwtToken, tokenCookie))
|
||||
c.SetUserContext(context.WithValue(c.UserContext(), consts.SessionUser, user))
|
||||
c.SetUserContext(context.WithValue(c.UserContext(), consts.CtxKeyJwt, tokenCookie))
|
||||
c.SetUserContext(context.WithValue(c.UserContext(), consts.CtxKeySession, user))
|
||||
|
||||
return c.Next()
|
||||
}
|
||||
@@ -113,7 +113,7 @@ func (f *Middlewares) AuthUserInfo(c fiber.Ctx) error {
|
||||
|
||||
var oauthInfo pg.UserOAuth
|
||||
copier.Copy(&oauthInfo, token)
|
||||
user, err := f.userSvc.GetOrNew(c.Context(), token.Openid, oauthInfo)
|
||||
user, err := f.userSvc.GetOrNew(c.Context(), 1, token.Openid, oauthInfo)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to get user")
|
||||
}
|
||||
@@ -127,7 +127,7 @@ func (f *Middlewares) AuthUserInfo(c fiber.Ctx) error {
|
||||
|
||||
// set the openid to the cookie
|
||||
c.Cookie(&fiber.Cookie{
|
||||
Name: "sid",
|
||||
Name: "token",
|
||||
Value: jwtToken,
|
||||
HTTPOnly: true,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user