mirror of
https://github.com/datarhei/core.git
synced 2025-10-05 16:07:07 +08:00
Change anon user to localhost user only if DisableLocalhost is set
This commit is contained in:
@@ -36,9 +36,8 @@ func NewAbout(restream restream.Restreamer, auths func() []string) *AboutHandler
|
||||
// @Router /api [get]
|
||||
func (p *AboutHandler) About(c echo.Context) error {
|
||||
user, _ := c.Get("user").(string)
|
||||
disablelocalhost, _ := c.Get("disablelocalhost").(bool)
|
||||
|
||||
if user == "$anon" || (user == "$localhost" && !disablelocalhost) {
|
||||
if user == "$anon" {
|
||||
return c.JSON(http.StatusOK, api.MinimalAbout{
|
||||
App: app.Name,
|
||||
Auths: p.auths(),
|
||||
|
Reference in New Issue
Block a user