mirror of
https://codeberg.org/MarkusThielker/next-ory.git
synced 2025-04-10 11:58:41 +00:00
Rename onAccept, onReject functions; update useEffect dependencies in consentForm.tsx
Fix: `./src/components/accountSessions.tsx 27:8 Warning: React Hook useCallback has a missing dependency: 'loadSessions'. Either include it or remove the dependency array. react-hooks/exhaustive-deps 50:8 Warning: React Hook useEffect has a missing dependency: 'loadSessions'. Either include it or remove the dependency array. react-hooks/exhaustive-deps`
This commit is contained in:
parent
d73f90b6ce
commit
e62fc35d12
1 changed files with 7 additions and 7 deletions
|
@ -13,15 +13,15 @@ import { Button } from '@/components/ui/button';
|
|||
|
||||
interface ConsentFormProps {
|
||||
request: OAuth2ConsentRequest;
|
||||
onAccept: (challenge: string, scopes: string[], remember: boolean) => void;
|
||||
onReject: (challenge: string) => void;
|
||||
onAcceptAction: (challenge: string, scopes: string[], remember: boolean) => void;
|
||||
onRejectAction: (challenge: string) => void;
|
||||
}
|
||||
|
||||
export default function ConsentForm(
|
||||
{
|
||||
request,
|
||||
onAccept,
|
||||
onReject,
|
||||
onAcceptAction,
|
||||
onRejectAction,
|
||||
}: ConsentFormProps,
|
||||
) {
|
||||
|
||||
|
@ -37,7 +37,7 @@ export default function ConsentForm(
|
|||
.toSession()
|
||||
.then(({ data }) => setSession(data))
|
||||
.catch(() => router.push('/flow/login'));
|
||||
}, []);
|
||||
}, [router]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
@ -106,12 +106,12 @@ export default function ConsentForm(
|
|||
<CardFooter className="flex w-full space-x-2 justify-end">
|
||||
<Button
|
||||
variant="outline"
|
||||
onClick={() => onReject(request.challenge)}>
|
||||
onClick={() => onRejectAction(request.challenge)}>
|
||||
Reject
|
||||
</Button>
|
||||
<Button
|
||||
variant="default"
|
||||
onClick={() => onAccept(request.challenge, requestedScopes, remember)}>
|
||||
onClick={() => onAcceptAction(request.challenge, requestedScopes, remember)}>
|
||||
Accept
|
||||
</Button>
|
||||
</CardFooter>
|
||||
|
|
Loading…
Add table
Reference in a new issue