louislam/dockge · error · Error
You are not logged in.
Error message
You are not logged in.
What it means
checkLogin() in backend/util-server.ts guards every authenticated socket handler: if the socket has no userID (login did not happen or the session was lost), it throws 'You are not logged in.'. Dockge handlers call it first so unauthenticated clients can never touch stacks, files, or user data. It is called by handlers such as create/create2.
Source
Thrown at backend/util-server.ts:44
sslKey? : string;
sslCert? : string;
sslKeyPassphrase? : string;
port? : number;
hostname? : string;
dataDir? : string;
stacksDir? : string;
enableConsole? : boolean;
}
// Some config values are required
export interface Config extends Arguments {
dataDir : string;
stacksDir : string;
}
export function checkLogin(socket : DockgeSocket) {
if (!socket.userID) {
throw new Error("You are not logged in.");
}
}
export class ValidationError extends Error {
constructor(message : string) {
super(message);
}
}
export function callbackError(error : unknown, callback : unknown) {
if (typeof(callback) !== "function") {
log.error("console", "Callback is not a function");
return;
}
if (error instanceof Error) {
callback({
ok: false,View on GitHub (pinned to f809ae192b)
Solutions
- Log in again from the Dockge UI to establish a new authenticated socket session
- Reload the page so the frontend reconnects and re-authenticates the socket
- In custom clients, perform the login event first and only then call protected actions
- Check server logs for token/auth errors if login appears to succeed but the error persists
Example fix
// before (custom client calls protected handler directly)
socket.emit("createStack", name, ...);
// after
socket.emit("login", username, password, (res) => {
if (res.ok) socket.emit("createStack", name, ...);
}); Defensive patterns
Strategy: type-guard
Validate before calling
// client-side: only emit protected events with an authenticated socket
if (socket.userID) {
socket.emit("createStack", name, composeYAML);
} else {
redirectToLogin();
} Type guard
function isLoggedIn(socket) {
return typeof socket.userID === "string" && socket.userID.length > 0;
} Try / catch
try {
checkLogin(socket);
// ... protected handler body
} catch (e) {
if (e.message === "You are not logged in.") {
socket.emit("authError", "Please log in again."); // prompt re-login client-side
} else throw e;
} Prevention
- Re-authenticate/reload after any Dockge server restart
- In automation, always perform the login handshake before other socket calls
- Handle token expiry by re-login instead of retrying protected calls
- Check socket.userID before invoking handlers that guard with checkLogin
When it happens
Trigger: Emitting a socket event that calls checkLogin (e.g. createStack, create2) from a socket that never completed the login handshake, whose token was rejected, or whose session was cleared (server restart, token expiry).
Common situations: Frontend kept open across a Dockge server restart, so the old socket lacks a userID; scripts/automation hitting the socket API without logging in; expired or revoked JWT after password change.
Related errors
- Wrong data type?
- Incorrect current password
- Password is too weak. It should contain alphabetic and numer
- Dockge has been initialized. If you want to run setup again,
- The token is invalid due to password change or old token
AI-assisted analysis of louislam/dockge@f809ae192b (2026-08-31).
Data as JSON: /api/errors/fa5a06da6634193d.
Report an issue: GitHub.