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

[1.x] Returns JSON response #267

Merged
merged 3 commits into from
May 20, 2021
Merged

[1.x] Returns JSON response #267

merged 3 commits into from
May 20, 2021

Conversation

ErwinLiemburg
Copy link
Contributor

The VerifyEmailController only had support for returning a redirect to a page. But when using API to confirm a new user, a JSON reply is expected. Changed the code to support the functionality, that when required the response is in JSON format.

Had to remove the return type, to be able to support JSON reply.

If anything can be improved, please be my guest.

The VerifyEmailController only had support for returning a redirect to a page. But when using API to confirm a new user, a JSON reply is expected. Changed the code to support the functionality, that when required the response is in JSON format.
@driesvints driesvints changed the title returns json response [1.x] Returns JSON response May 20, 2021
Changed the use order.
Fixed StyleCI issues
@taylorotwell
Copy link
Member

The user clicks the verification link in their email client and is sent to the page. How would it be triggered for an API request?

@ErwinLiemburg
Copy link
Contributor Author

By default the link in the email links to the 'default' laravel verification page. But when you use laravel as a backend API with a SPA, it seems weird that the link is sent to a page different from the SPA. By changing the link in the verification email, sending it to the SPA, the SPA can therefor send a verification request, and handle the result. The SPA would require a JSON reply, and not a redirect to another page.

@taylorotwell taylorotwell merged commit 849162a into laravel:1.x May 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants