mirror of
https://codeberg.org/MarkusThielker/next-ory.git
synced 2025-04-18 00:21:18 +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 {
|
interface ConsentFormProps {
|
||||||
request: OAuth2ConsentRequest;
|
request: OAuth2ConsentRequest;
|
||||||
onAccept: (challenge: string, scopes: string[], remember: boolean) => void;
|
onAcceptAction: (challenge: string, scopes: string[], remember: boolean) => void;
|
||||||
onReject: (challenge: string) => void;
|
onRejectAction: (challenge: string) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function ConsentForm(
|
export default function ConsentForm(
|
||||||
{
|
{
|
||||||
request,
|
request,
|
||||||
onAccept,
|
onAcceptAction,
|
||||||
onReject,
|
onRejectAction,
|
||||||
}: ConsentFormProps,
|
}: ConsentFormProps,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ export default function ConsentForm(
|
||||||
.toSession()
|
.toSession()
|
||||||
.then(({ data }) => setSession(data))
|
.then(({ data }) => setSession(data))
|
||||||
.catch(() => router.push('/flow/login'));
|
.catch(() => router.push('/flow/login'));
|
||||||
}, []);
|
}, [router]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
@ -106,12 +106,12 @@ export default function ConsentForm(
|
||||||
<CardFooter className="flex w-full space-x-2 justify-end">
|
<CardFooter className="flex w-full space-x-2 justify-end">
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
onClick={() => onReject(request.challenge)}>
|
onClick={() => onRejectAction(request.challenge)}>
|
||||||
Reject
|
Reject
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
variant="default"
|
variant="default"
|
||||||
onClick={() => onAccept(request.challenge, requestedScopes, remember)}>
|
onClick={() => onAcceptAction(request.challenge, requestedScopes, remember)}>
|
||||||
Accept
|
Accept
|
||||||
</Button>
|
</Button>
|
||||||
</CardFooter>
|
</CardFooter>
|
||||||
|
|
Loading…
Add table
Reference in a new issue