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

fixes: dbAuth template and Apollo comment #6690

Merged
merged 2 commits into from
Oct 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@ export const handler = async (
// How long the resetToken is valid for, in seconds (default is 24 hours)
expires: 60 * 60 * 24,

// Include any format checks for password here. Return `true` if the
// password is valid, otherwise throw a `PasswordValidationError`.
// Import the error along with `DbAuthHandler` from `@redwoodjs/api` above.
passwordValidation: (_password) => {
return true
},

errors: {
// for security reasons you may want to be vague here rather than expose
// the fact that the email address wasn't found (prevents fishing for
Expand Down Expand Up @@ -125,6 +118,13 @@ export const handler = async (
})
},

// Include any format checks for password here. Return `true` if the
// password is valid, otherwise throw a `PasswordValidationError`.
// Import the error along with `DbAuthHandler` from `@redwoodjs/api` above.
passwordValidation: (_password) => {
return true
},

errors: {
// `field` will be either "username" or "password"
fieldMissing: '${field} is required',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ export const handler = async (
// How long the resetToken is valid for, in seconds (default is 24 hours)
expires: 60 * 60 * 24,

// Include any format checks for password here. Return `true` if the
// password is valid, otherwise throw a `PasswordValidationError`.
// Import the error along with `DbAuthHandler` from `@redwoodjs/api` above.
passwordValidation: (_password) => {
return true
},

errors: {
// for security reasons you may want to be vague here rather than expose
// the fact that the email address wasn't found (prevents fishing for
Expand Down
3 changes: 1 addition & 2 deletions packages/web/src/apollo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,7 @@ export const RedwoodApolloProvider: React.FunctionComponent<{
return (
<FetchConfigProvider useAuth={useAuth}>
<ApolloProviderWithFetchConfig
// </FetchConfigProvider> This order so that the user can still
// completely overwrite the cache.
// This order so that the user can still completely overwrite the cache
config={{ cache, ...config }}
useAuth={useAuth}
logLevel={logLevel}
Expand Down