Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(NET-1540): add cfg to autoclose connections on rac, when logged out #3130

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions logic/jwts.go
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't the value be checked from the auto-disable config?

Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func CreateUserJWT(username string, role models.UserRoleID) (response string, er
claims := &models.UserClaims{
UserName: username,
Role: role,
RacAutoDisable: (role != models.SuperAdminRole && role != models.AdminRole),
RegisteredClaims: jwt.RegisteredClaims{
Issuer: "Netmaker",
Subject: fmt.Sprintf("user|%s", username),
Expand Down
5 changes: 3 additions & 2 deletions models/user_mgmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,9 @@ type UserAuthParams struct {

// UserClaims - user claims struct
type UserClaims struct {
Role UserRoleID
UserName string
Role UserRoleID
UserName string
RacAutoDisable bool
jwt.RegisteredClaims
}

Expand Down
Loading