mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-09 16:50:28 +03:00
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
17
src/app/hooks/useAccountManagement.ts
Normal file
17
src/app/hooks/useAccountManagement.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { useMemo } from 'react';
|
||||
|
||||
export const useAccountManagementActions = () => {
|
||||
const actions = useMemo(
|
||||
() => ({
|
||||
profile: 'org.matrix.profile',
|
||||
sessionsList: 'org.matrix.sessions_list',
|
||||
sessionView: 'org.matrix.session_view',
|
||||
sessionEnd: 'org.matrix.session_end',
|
||||
accountDeactivate: 'org.matrix.account_deactivate',
|
||||
crossSigningReset: 'org.matrix.cross_signing_reset',
|
||||
}),
|
||||
[]
|
||||
);
|
||||
|
||||
return actions;
|
||||
};
|
||||
12
src/app/hooks/useAuthMetadata.ts
Normal file
12
src/app/hooks/useAuthMetadata.ts
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import { ValidatedAuthMetadata } from 'matrix-js-sdk';
|
||||
import { createContext, useContext } from 'react';
|
||||
|
||||
const AuthMetadataContext = createContext<ValidatedAuthMetadata | undefined>(undefined);
|
||||
|
||||
export const AuthMetadataProvider = AuthMetadataContext.Provider;
|
||||
|
||||
export const useAuthMetadata = (): ValidatedAuthMetadata | undefined => {
|
||||
const metadata = useContext(AuthMetadataContext);
|
||||
|
||||
return metadata;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue