Link device account management with OIDC (#2390)
* load auth metadata configs on startup * deep-link cross-signing reset button with oidc * deep-link manage devices and delete device with oidc * fix import typo
This commit is contained in:
parent
c30c142653
commit
c462a3b8d5
7 changed files with 185 additions and 52 deletions
|
|
@ -32,6 +32,9 @@ import {
|
|||
DeviceVerificationSetup,
|
||||
} from '../../../components/DeviceVerificationSetup';
|
||||
import { stopPropagation } from '../../../utils/keyboard';
|
||||
import { useAuthMetadata } from '../../../hooks/useAuthMetadata';
|
||||
import { withSearchParam } from '../../../pages/pathUtils';
|
||||
import { useAccountManagementActions } from '../../../hooks/useAccountManagement';
|
||||
|
||||
type VerificationStatusBadgeProps = {
|
||||
verificationStatus: VerificationStatus;
|
||||
|
|
@ -252,6 +255,8 @@ export function EnableVerification({ visible }: EnableVerificationProps) {
|
|||
|
||||
export function DeviceVerificationOptions() {
|
||||
const [menuCords, setMenuCords] = useState<RectCords>();
|
||||
const authMetadata = useAuthMetadata();
|
||||
const accountManagementActions = useAccountManagementActions();
|
||||
|
||||
const [reset, setReset] = useState(false);
|
||||
|
||||
|
|
@ -265,6 +270,18 @@ export function DeviceVerificationOptions() {
|
|||
|
||||
const handleReset = () => {
|
||||
setMenuCords(undefined);
|
||||
|
||||
if (authMetadata) {
|
||||
const authUrl = authMetadata.account_management_uri ?? authMetadata.issuer;
|
||||
window.open(
|
||||
withSearchParam(authUrl, {
|
||||
action: accountManagementActions.crossSigningReset,
|
||||
}),
|
||||
'_blank'
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
setReset(true);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue