chore: document user login state
This commit is contained in:
parent
3771890f98
commit
2299907932
@ -64,7 +64,7 @@ function mapRoleToName(role: string) {
|
|||||||
case 'invalid-oidc':
|
case 'invalid-oidc':
|
||||||
return <p className="opacity-50">Invalid</p>;
|
return <p className="opacity-50">Invalid</p>;
|
||||||
case 'no-role':
|
case 'no-role':
|
||||||
return <p className="opacity-50">No Role</p>;
|
return <p className="opacity-50">Unregistered</p>;
|
||||||
case 'owner':
|
case 'owner':
|
||||||
return 'Owner';
|
return 'Owner';
|
||||||
case 'admin':
|
case 'admin':
|
||||||
|
|||||||
@ -3,7 +3,6 @@ import { PersonIcon } from '@primer/octicons-react';
|
|||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import type { ActionFunctionArgs, LoaderFunctionArgs } from 'react-router';
|
import type { ActionFunctionArgs, LoaderFunctionArgs } from 'react-router';
|
||||||
import { useLoaderData, useSubmit } from 'react-router';
|
import { useLoaderData, useSubmit } from 'react-router';
|
||||||
import { ClientOnly } from 'remix-utils/client-only';
|
|
||||||
import Attribute from '~/components/Attribute';
|
import Attribute from '~/components/Attribute';
|
||||||
import Card from '~/components/Card';
|
import Card from '~/components/Card';
|
||||||
import { ErrorPopup } from '~/components/Error';
|
import { ErrorPopup } from '~/components/Error';
|
||||||
@ -54,6 +53,9 @@ export async function loader({
|
|||||||
return role ?? 'no-role';
|
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';
|
return 'no-role';
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user