Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(consent): add different functionality for cancel button on login. #4423

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

amitamrutiya
Copy link

Fix issue #4396

Give a different type to the cancel button and add functionality to go back when the cancel button is clicked. Previously, the cancel button would submit the form.

@amitamrutiya amitamrutiya changed the title feat(dashboard): add different functionality for cancel button on login. feat(consent): add different functionality for cancel button on login. May 5, 2024
@krtk6160 krtk6160 requested a review from siddhart1o1 May 5, 2024 06:34
Copy link
Member

@siddhart1o1 siddhart1o1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is an issue. There is a reason when you click on "Cancel," the form is submitted; i.e., when we click "Cancel," this section is triggered:

if (submitValue === SubmitValue.denyAccess) {

@amitamrutiya
Copy link
Author

Thanks @siddhart1o1 for the review. I have a question: Is there a specific reason why we make an API call when the cancel button is pressed? I believe if the user presses the cancel button, we shouldn't need to make an API call.

@siddhart1o1
Copy link
Member

I have a question: Is there a specific reason why we make an API call when the cancel button is pressed? I believe if the user presses the cancel button, we shouldn't need to make an API call.

Because it's part of the form, we are using server actions to handle form submission, where we are also handling the deny/cancel case.
https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants