세션 무효화 처리 강화

This commit is contained in:
2024-02-21 12:08:33 +09:00
parent 0c5ddac9f5
commit 0ca764d6be
7 changed files with 101 additions and 49 deletions

View File

@ -368,6 +368,11 @@ func (ws *websocketPeerHandler[T]) upgrade(w http.ResponseWriter, r *http.Reques
return
}
if authinfo.Account.IsZero() || authinfo.Invalidated() {
w.WriteHeader(http.StatusUnauthorized)
return
}
var upgrader = websocket.Upgrader{} // use default options
conn, err := upgrader.Upgrade(w, r, nil)
if err != nil {