fix: display correct button on unauthed room page

This commit is contained in:
efim
2023-11-23 06:14:54 +00:00
parent f7def011f5
commit 550841e882
2 changed files with 5 additions and 5 deletions

View File

@@ -177,13 +177,13 @@ func roomPageRoute(
// check session,
session, err := getRequestSession(r, sessionSM)
room, found, err := roomsM.Get(roomName)
if err != nil || session.RoomId != roomName {
log.Printf("not authed with session %+v | error %s, but for wrong room, trying to access %s", session, err, roomName)
renderLoginPage(w, roomName)
renderLoginPage(w, roomName, found)
return
}
room, found, err := roomsM.Get(roomName)
if err != nil || !found {
log.Printf("/room room for name %s not found or err: %s / found %t", roomName, err, found)
// TODO here should be append to error place