{"record":{"id":"880da267ddfa77fc","repo":"mattermost-community/focalboard","slug":"errorid-notloggedin","errorCode":"ErrorId.NotLoggedIn","errorMessage":"NotLoggedIn","messagePattern":"NotLoggedIn","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"webapp/src/store/initialLoad.ts","lineNumber":28,"sourceCode":"import {RootState} from './index'\n\nexport const initialLoad = createAsyncThunk(\n    'initialLoad',\n    async () => {\n        const [me, myConfig, team, teams, boards, boardsMemberships, boardTemplates, limits] = await Promise.all([\n            client.getMe(),\n            client.getMyConfig(),\n            client.getTeam(),\n            client.getTeams(),\n            client.getBoards(),\n            client.getMyBoardMemberships(),\n            client.getTeamTemplates(),\n            client.getBoardsCloudLimits(),\n        ])\n\n        // if no me, normally user not logged in\n        if (!me) {\n            throw new Error(ErrorId.NotLoggedIn)\n        }\n\n        // if no team, either bad id, or user doesn't have access\n        if (!team) {\n            throw new Error(ErrorId.TeamUndefined)\n        }\n        return {\n            team,\n            teams,\n            boards,\n            boardsMemberships,\n            boardTemplates,\n            limits,\n            myConfig,\n        }\n    },\n)\n","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/mattermost-community/focalboard/blob/a84bbb65e32edf972856b329417096ac413518e9/webapp/src/store/initialLoad.ts#L10-L46","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Redirect the user to the login flow when this error is caught","Verify the auth token/cookie is present and valid (check browser devtools for the session cookie on /api requests)","Re-authenticate: log in again or refresh the SSO session","Check proxy/iframe configurations that may strip cookies or block third-party cookies"],"exampleFix":"// before\nawait initialLoad() // throws NotLoggedIn, unhandled\n// after\ntry {\n  await initialLoad()\n} catch (e) {\n  if (e.message === 'NotLoggedIn') {\n    window.location.href = '/login'\n  }\n}","handlingStrategy":"try-catch","validationCode":"const res = await fetch('/api/v2/users/me', {credentials: 'include'})\nconst isAuthenticated = res.ok","typeGuard":"function isNotLoggedInError(e: unknown): e is Error {\n  return e instanceof Error && e.message === 'NotLoggedIn'\n}","tryCatchPattern":"try {\n  await initialLoad()\n} catch (e) {\n  if (isNotLoggedInError(e)) {\n    window.location.href = '/login'\n    return\n  }\n  throw e\n}","preventionTips":["Check session validity before heavy initial loads","Handle session expiry globally (interceptor that redirects to login)","Test with cookies disabled/expired to verify the redirect path","Be careful with iframe embedding and third-party cookie blocking"],"tags":["typescript","authentication","session","frontend"],"backgroundTag":"not-authenticated","analyzedSha":"a84bbb65e32edf972856b329417096ac413518e9","analyzedAt":"2026-08-30T09:22:20.720Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}