8000 Fix misplaced requires properties by cwstra · Pull Request #2597 · better-auth/better-auth · GitHub
[go: up one dir, main page]

Skip to content

Fix misplaced requires properties #2597

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

Merged
merged 2 commits into from
May 9, 2025
Merged

Fix misplaced requires properties #2597

merged 2 commits into from
May 9, 2025

Conversation

cwstra
Copy link
Contributor
@cwstra cwstra commented May 9, 2025

While using openapi-typescript on the result of generateOpenAPISchema, two of my endpoints caused validation errors. Turns out, these had their required values inside of their properties object, rather than adjacent to it as the spec states.

Copy link
jazzberry-ai bot commented May 9, 2025

Bug Report

Name: Missing required fields in API responses
Severity: Medium
Example test case: Call the /verify-email or /sign-in/social endpoint and observe a successful response where either the status, user, redirect or token fields are missing. Then, attempt to access these fields in the client. This will cause an error.
Description: The patch removes the required field from the response schema definitions for the /email-verification and /sign-in-social routes. This can lead to issues if the client relies on these fields being present. The client code doesn't properly check for the existence of these fields before accessing them, which can cause runtime errors.

Comments? Email us.

Copy link
vercel bot commented May 9, 2025

@cwstra is attempting to deploy a commit to the better-auth Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
@mrge-io mrge-io bot left a comment

Choose a reason for hiding this comment

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

mrge reviewed 2 files and found no issues. Review PR in mrge.io.

Copy link
pkg-pr-new bot commented May 9, 2025

Open in StackBlitz

npm i https://pkg.pr.new/better-auth/better-auth@2597
npm i https://pkg.pr.new/better-auth/better-auth/@better-auth/cli@2597
npm i https://pkg.pr.new/better-auth/better-auth/@better-auth/expo@2597
npm i https://pkg.pr.new/better-auth/better-auth/@better-auth/stripe@2597

commit: fdeb903

@Bekacru Bekacru merged commit fdf3efb into better-auth:main May 9, 2025
4 of 6 checks passed
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.

2 participants
0