Add backups, currencies and dashboard APIs, and scope access by guard_name.
Web users may only CRUD their own records, operators stay in assigned branches, and admin/manager/superadmin keep full access. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -37,7 +37,7 @@ func NewClient(ctx context.Context, maxAttempts int, sc config.StorageConfig) (*
|
||||
cfg.MaxConns = int32(sc.PgPoolMaxConn)
|
||||
cfg.HealthCheckPeriod = 2 * time.Second
|
||||
cfg.MaxConnLifetime = 24 * time.Hour
|
||||
cfg.MaxConnIdleTime = 2 * time.Second
|
||||
cfg.MaxConnIdleTime = 30 * time.Minute
|
||||
|
||||
cfg.ConnConfig.ConnectTimeout = 1 * time.Second
|
||||
cfg.ConnConfig.DialFunc = (&net.Dialer{
|
||||
|
||||
@@ -35,7 +35,7 @@ func generateTokenPair(id int, admin bool) (map[string]string, error) {
|
||||
accessToken := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.MapClaims{
|
||||
"id": id,
|
||||
"admin": admin,
|
||||
"exp": time.Now().Add(time.Hour).Unix(),
|
||||
"exp": time.Now().Add(7*24*time.Hour).Unix(),
|
||||
})
|
||||
|
||||
access, err := accessToken.SignedString(secret)
|
||||
|
||||
Reference in New Issue
Block a user