mattermost-community/focalboard · warning · Error

ErrorId.NotLoggedIn

ErrorId.NotLoggedIn

Error message

NotLoggedIn

What it means

initialLoad throws new Error(ErrorId.NotLoggedIn) when the /users/me request returns no user, meaning the client is not authenticated. It aborts the app's initial data load so the UI can route to login.

Solutions

  1. Redirect the user to the login flow when this error is caught
  2. Verify the auth token/cookie is present and valid (check browser devtools for the session cookie on /api requests)
  3. Re-authenticate: log in again or refresh the SSO session
  4. Check proxy/iframe configurations that may strip cookies or block third-party cookies

Example fix

// before
await initialLoad() // throws NotLoggedIn, unhandled
// after
try {
  await initialLoad()
} catch (e) {
  if (e.message === 'NotLoggedIn') {
    window.location.href = '/login'
  }
}
Defensive patterns

Strategy: try-catch

Validate before calling

const res = await fetch('/api/v2/users/me', {credentials: 'include'})
const isAuthenticated = res.ok

Type guard

function isNotLoggedInError(e: unknown): e is Error {
  return e instanceof Error && e.message === 'NotLoggedIn'
}

Try / catch

try {
  await initialLoad()
} catch (e) {
  if (isNotLoggedInError(e)) {
    window.location.href = '/login'
    return
  }
  throw e
}

Prevention

When it happens

Trigger: Loading the webapp without a valid session cookie/token; a session that expired before initialLoad ran; accessing the app through a reverse proxy that strips auth cookies.

Common situations: Expired sessions after idle time, SSO/token misconfiguration, cookies blocked by browser settings, or embedding the app in an iframe where third-party cookies are disabled.

Related errors


AI-assisted analysis of mattermost-community/focalboard@a84bbb65e3 (2026-08-30). Data as JSON: /api/errors/880da267ddfa77fc. Report an issue: GitHub.

Appendix: source

Thrown at webapp/src/store/initialLoad.ts:28

import {RootState} from './index'

export const initialLoad = createAsyncThunk(
    'initialLoad',
    async () => {
        const [me, myConfig, team, teams, boards, boardsMemberships, boardTemplates, limits] = await Promise.all([
            client.getMe(),
            client.getMyConfig(),
            client.getTeam(),
            client.getTeams(),
            client.getBoards(),
            client.getMyBoardMemberships(),
            client.getTeamTemplates(),
            client.getBoardsCloudLimits(),
        ])

        // if no me, normally user not logged in
        if (!me) {
            throw new Error(ErrorId.NotLoggedIn)
        }

        // if no team, either bad id, or user doesn't have access
        if (!team) {
            throw new Error(ErrorId.TeamUndefined)
        }
        return {
            team,
            teams,
            boards,
            boardsMemberships,
            boardTemplates,
            limits,
            myConfig,
        }
    },
)

View on GitHub (pinned to a84bbb65e3)