Check for did match on redirect

This commit is contained in:
Eric Bailey
2025-07-11 16:04:23 -05:00
parent 3b2f70c269
commit 0ee7b8a0a5
2 changed files with 7 additions and 8 deletions
@@ -61,10 +61,6 @@ export function AgeAssuranceRedirectDialog() {
const {_} = useLingui()
const control = useAgeAssuranceRedirectDialogControl()
// Dialog.useAutoOpen(control.control, 1e3)
// TODO maybe handle invalid DID here
return (
<Dialog.Outer control={control.control}>
<Dialog.Handle />
+7 -4
View File
@@ -27,6 +27,7 @@ export function useIntentHandler() {
const verifyEmailIntent = useVerifyEmailIntent()
const ageAssuranceRedirectDialogControl =
useAgeAssuranceRedirectDialogControl()
const {currentAccount} = useSession()
React.useEffect(() => {
const handleIncomingURL = (url: string) => {
@@ -78,9 +79,11 @@ export function useIntentHandler() {
actorDid: params.get('actorDid') ?? undefined,
})
// TODO maybe handle invalid DID here
if (state) {
if (
state &&
currentAccount &&
state.actorDid === currentAccount.did
) {
ageAssuranceRedirectDialogControl.open(state)
}
return
@@ -103,6 +106,7 @@ export function useIntentHandler() {
composeIntent,
verifyEmailIntent,
ageAssuranceRedirectDialogControl,
currentAccount,
])
}
@@ -122,7 +126,6 @@ export function useComposeIntent() {
videoUri: string | null
}) => {
if (!hasSession) return
closeAllActiveElements()
// Whenever a video URI is present, we don't support adding images right now.