chore: document user login state

This commit is contained in:
Aarnav Tale 2025-03-29 14:28:11 -04:00
parent 3771890f98
commit 2299907932
No known key found for this signature in database
2 changed files with 4 additions and 2 deletions

View File

@ -64,7 +64,7 @@ function mapRoleToName(role: string) {
case 'invalid-oidc':
return <p className="opacity-50">Invalid</p>;
case 'no-role':
return <p className="opacity-50">No Role</p>;
return <p className="opacity-50">Unregistered</p>;
case 'owner':
return 'Owner';
case 'admin':

View File

@ -3,7 +3,6 @@ import { PersonIcon } from '@primer/octicons-react';
import { useEffect, useState } from 'react';
import type { ActionFunctionArgs, LoaderFunctionArgs } from 'react-router';
import { useLoaderData, useSubmit } from 'react-router';
import { ClientOnly } from 'remix-utils/client-only';
import Attribute from '~/components/Attribute';
import Card from '~/components/Card';
import { ErrorPopup } from '~/components/Error';
@ -54,6 +53,9 @@ export async function loader({
return role ?? 'no-role';
}
// No role means the user is not registered in Headplane, but they
// are in Headscale. We also need to handle what happens if someone
// logs into the UI and they don't have a Headscale setup.
return 'no-role';
});