Skip to content

Commit

Permalink
fix: del the chan admin password encryption (#331)
Browse files Browse the repository at this point in the history
* feat: add some api about admin

* feat: add some api about admin

* fix: del the unuse method

* fix: Optimized code

* fix: fix the userID

* fix: del the config code getting from zk

* fix: fix the initRedis

* fix: add the get Evn method in Config

* fix: fix the config.yaml.template

* fix: fix the env config

* feat: add some conponent env

* fix: fix the openIMURL

* fix: find the zk don't connect error

* fix: find the zk error

* fix: test the jz error

* fix: delt the log

* fix: fix the component error

* fix: fix the error of get env  location

* fix: fix the error

* fix: fix the zk start error

* fix: fix the Config

* fix: testing

* fix: fix the config.Env error

* fix: fix the componentCheck

* fix: fix the config

* fix: find the error

* fix: del the flag

* fix: fix the error

* fix: fix the password error

* fix: del the proxyHeader field

* fix: fix the openIMurl
  • Loading branch information
luhaoling authored Dec 19, 2023
1 parent 53c4eff commit 37a1a9d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions deployments/templates/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ verifyCode:
smtpPort: 465 # SMTP server port for email sending

# Proxy header configuration for IP extraction
proxyHeader: "X-Forwarded-For" # PROXY_HEADER, Header used for extracting the client IP address
# proxyHeader: "X-Forwarded-For" # PROXY_HEADER, Header used for extracting the client IP address

# List of admin users
adminList:
Expand All @@ -118,7 +118,7 @@ adminList:
imAdmin: openIMAdmin

# URL for OpenIM server
openIMUrl: "172.28.0.1:10002" # OPENIM_SERVER_ADDRESS:API_OPENIM_PORT, URL of the OpenIM server
openIMUrl: "http://127.0.0.1:10002" # OPENIM_SERVER_ADDRESS:API_OPENIM_PORT, URL of the OpenIM server

# Redis configuration - used for caching and session management
redis:
Expand Down
4 changes: 2 additions & 2 deletions internal/rpc/admin/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func (o *adminServer) AddAdminAccount(ctx context.Context, req *admin.AddAdminAc

adm := &admin2.Admin{
Account: req.Account,
Password: o.passwordEncryption(req.Password),
Password: req.Password,
FaceURL: req.FaceURL,
Nickname: req.Nickname,
UserID: o.genUserID(),
Expand Down Expand Up @@ -233,7 +233,7 @@ func (o *adminServer) Login(ctx context.Context, req *admin.LoginReq) (*admin.Lo
}
return nil, err
}
if a.Password != o.passwordEncryption(req.Password) {
if a.Password != req.Password {
return nil, eerrs.ErrPassword.Wrap()
}
adminToken, err := o.CreateToken(ctx, &admin.CreateTokenReq{UserID: a.UserID, UserType: constant.AdminUser})
Expand Down

0 comments on commit 37a1a9d

Please sign in to comment.