m1k1o/neko · error
is not the admin
Error message
is not the admin
What it means
screenSet in server/internal/websocket/handler/screen.go rejects screen size changes when the sending session's profile lacks IsAdmin. Changing the remote display resolution is an administrative action in neko because it affects all viewers and can disrupt the shared desktop.
Source
Thrown at server/internal/websocket/handler/screen.go:13
package handler
import (
"errors"
"github.com/m1k1o/neko/server/pkg/types"
"github.com/m1k1o/neko/server/pkg/types/event"
"github.com/m1k1o/neko/server/pkg/types/message"
)
func (h *MessageHandlerCtx) screenSet(session types.Session, payload *message.ScreenSize) error {
if !session.Profile().IsAdmin {
return errors.New("is not the admin")
}
size, err := h.desktop.SetScreenSize(payload.ScreenSize)
if err != nil {
return err
}
h.sessions.Broadcast(event.SCREEN_UPDATED, message.ScreenSizeUpdate{
ID: session.ID(),
ScreenSize: size,
})
return nil
}
View on GitHub (pinned to b0f01cedea)
Solutions
- Log in / create the session with an admin profile (IsAdmin: true) if resolution control is required.
- Use an admin account for screen configuration changes.
- Disable or hide the screen settings UI for non-admin clients.
- Verify the auth/membership provider actually returns the admin flag for the account.
Example fix
// before
profile := types.MemberProfile{ CanWatch: true, CanHost: true }
// after
profile := types.MemberProfile{ CanWatch: true, CanHost: true, IsAdmin: true } Defensive patterns
Strategy: validation
Validate before calling
// client-side, before sending screen size
if (!session.profile.isAdmin) {
console.warn('screen configuration requires admin')
return
} Type guard
function isAdmin(session) {
return session?.profile?.isAdmin === true
} Try / catch
try {
socket.emit('screen/set', screenSize)
} catch (e) {
if (e.message === 'is not the admin') promptAdminLogin()
} Prevention
- Hide screen settings UI for non-admin profiles.
- Remember IsAdmin is separate from CanHost — hosts still cannot change resolution.
- Use an admin account for resolution changes.
- Verify your auth provider maps the admin role to IsAdmin correctly.
When it happens
Trigger: Sending a screen size set message while session.Profile().IsAdmin is false — e.g. any non-admin member calling the screen configuration handler.
Common situations: A regular host tries to change resolution assuming host rights suffice (admin flag is separate); custom member profiles created without IsAdmin; self-hosted setups where users log in with default non-admin credentials and attempt resolution changes via the UI.
Understand the failure class
Background: "You do not have permission" / 403 Forbidden errors: authenticated but not allowed — causes and fixes across open-source libraries — this error's family across 31 libraries.
Related errors
AI-assisted analysis of m1k1o/neko@b0f01cedea (2026-09-01).
Data as JSON: /api/errors/9da25ed28f375508.
Report an issue: GitHub.