File tree Expand file tree Collapse file tree 4 files changed +11
-3
lines changed
Expand file tree Collapse file tree 4 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ require github.com/mattn/go-sqlite3 v1.14.24
66
77require (
88 github.com/L4B0MB4/EVTSRC v0.5.3 // indirect
9- github.com/PRYVT/utils v0.3 .0 // indirect
9+ github.com/PRYVT/utils v0.4 .0 // indirect
1010 github.com/bytedance/sonic v1.12.2 // indirect
1111 github.com/bytedance/sonic/loader v0.2.0 // indirect
1212 github.com/cloudwego/base64x v0.1.4 // indirect
Original file line number Diff line number Diff line change @@ -48,6 +48,8 @@ github.com/PRYVT/utils v0.2.1 h1:GiTbziM3lqRLc4EWGV28+T/aKaY+B80KTqnkBklf9q0=
4848github.com/PRYVT/utils v0.2.1 /go.mod h1:j61GmoyWWXgnCq/laZTIJm4yhD0PreLDMZnYQqjSv7w =
4949github.com/PRYVT/utils v0.3.0 h1:E0q08Gba+TdIsflKBA2XJLEE/RqbB8u3oXxy1wM7l+s =
5050github.com/PRYVT/utils v0.3.0 /go.mod h1:j61GmoyWWXgnCq/laZTIJm4yhD0PreLDMZnYQqjSv7w =
51+ github.com/PRYVT/utils v0.4.0 h1:RQ7u6sunsic1EfZqOiaZDZvPEJwyx/DlPWqdFlgZHwM =
52+ github.com/PRYVT/utils v0.4.0 /go.mod h1:G48oYenFuXUKVVA0sE/lmJlOwHGRacKH/9dNNae0DTk =
5153github.com/bytedance/sonic v1.11.6 h1:oUp34TzMlL+OY1OUWxHqsdkgC/Zfc85zGqw9siXjrc0 =
5254github.com/bytedance/sonic v1.11.6 /go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4 =
5355github.com/bytedance/sonic v1.12.2 h1:oaMFuRTpMHYLpCntGca65YWt5ny+wAceDERTkT2L9lg =
Original file line number Diff line number Diff line change 44 "github.com/L4B0MB4/EVTSRC/pkg/models"
55 "github.com/L4B0MB4/PRYVT/identification/pkg/aggregates"
66 "github.com/L4B0MB4/PRYVT/identification/pkg/query/store/repository"
7+ "github.com/PRYVT/utils/pkg/interfaces"
78 "github.com/google/uuid"
89 "github.com/rs/zerolog/log"
910)
@@ -18,6 +19,10 @@ func NewUserEventHandler(userRepo *repository.UserRepository) *UserEventHandler
1819 }
1920}
2021
22+ func (eh * UserEventHandler ) AddWebsocketConnection (conn interfaces.WebsocketConnecter ) {
23+ log .Warn ().Msg ("Websocket connection not yet supported for user events" )
24+ }
25+
2126func (eh * UserEventHandler ) HandleEvent (event models.Event ) error {
2227 if event .AggregateType == "user" {
2328 ua , err := aggregates .NewUserAggregate (uuid .MustParse (event .AggregateId ))
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package controller
22
33import (
44 "net/http"
5+ "time"
56
67 "github.com/L4B0MB4/PRYVT/identification/pkg/aggregates"
78 models "github.com/L4B0MB4/PRYVT/identification/pkg/models/query"
@@ -41,7 +42,7 @@ func (ctrl *UserController) GetToken(c *gin.Context) {
4142 c .JSON (http .StatusUnauthorized , gin.H {"error" : "Unauthorized" })
4243 return
4344 }
44- token , err := auth .CreateToken (userUuid )
45+ token , err := auth .CreateToken (userUuid , 12 * time . Hour )
4546 if err != nil {
4647 c .JSON (http .StatusInternalServerError , gin.H {"error" : err .Error ()})
4748 return
@@ -56,7 +57,7 @@ func (ctrl *UserController) RefreshToken(c *gin.Context) {
5657 c .JSON (http .StatusUnauthorized , gin.H {"error" : "Unauthorized" })
5758 return
5859 }
59- token , err := auth .CreateToken (userUuid )
60+ token , err := auth .CreateToken (userUuid , 12 * time . Hour )
6061
6162 if err != nil {
6263 c .JSON (http .StatusInternalServerError , gin.H {"error" : err .Error ()})
You can’t perform that action at this time.
0 commit comments