mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-04-19 19:59:13 +03:00
Fix username when authentication is disabled
This commit is contained in:
parent
954c54cbd9
commit
5ec77ecd72
1 changed files with 4 additions and 0 deletions
|
@ -27,6 +27,10 @@ func validSession(c echo.Context) {
|
|||
|
||||
// currentUser to get username of logged in user
|
||||
func currentUser(c echo.Context) string {
|
||||
if util.DisableLogin {
|
||||
return ""
|
||||
}
|
||||
|
||||
sess, _ := session.Get("session", c)
|
||||
username := fmt.Sprintf("%s", sess.Values["username"])
|
||||
return username
|
||||
|
|
Loading…
Add table
Reference in a new issue