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

restore login ability #321

Closed
3 tasks
alishaevn opened this issue Nov 7, 2023 · 2 comments · Fixed by #388
Closed
3 tasks

restore login ability #321

alishaevn opened this issue Nov 7, 2023 · 2 comments · Fixed by #388
Assignees
Labels
bug Something isn't working

Comments

@alishaevn
Copy link
Contributor

alishaevn commented Nov 7, 2023

Story

we are unable to login locally or in production (vercel). the workaround mentioned in the comments below does not work for this error.

this is not affecting phenovista's digital storefront.

Acceptance Criteria

  • we are able to log in to the correct marketplace in local dev
  • we are able to log in to the correct marketplace in production

Screenshots / Video

browser error image

INITIAL ISSUE

Story

locally, we are receiving a CORS error when pressing the "sign in" button. the same error is not seen at https://webstore-staging.vercel.app/.

Acceptance Criteria

  • we are able to log in to the correct marketplace in local dev again

Screenshots / Video

image

Testing Instructions and Sample Files

  • from the home page, click the "sign in" button and be redirected to the marketplace on the scientist.com domain
@alishaevn alishaevn added the bug Something isn't working label Nov 7, 2023
@alishaevn alishaevn self-assigned this Nov 7, 2023
@alishaevn
Copy link
Contributor Author

for the time being, we can get around this error locally by updating the code as stated below. it means we get taken to a "middle man" site where we have to choose to be taken to scientist. however, since this is only a problem locally, I'm setting this aside for more pressing issues.

# _app.js

# change this
signIn: () => signIn(process.env.NEXT_PUBLIC_PROVIDER_NAME)

# to this
signIn: () => signIn()

@alishaevn alishaevn removed their assignment Nov 7, 2023
@crisr15 crisr15 changed the title restore login ability restore login ability for local development Nov 14, 2023
@alishaevn alishaevn added the good first issue Good for newcomers label Jan 17, 2024
@alishaevn alishaevn changed the title restore login ability for local development restore login ability Feb 28, 2024
@alishaevn alishaevn removed the good first issue Good for newcomers label Feb 28, 2024
@alishaevn
Copy link
Contributor Author

unsure if it's related to the initial problem, but we are now unable to sign in locally, or on the production (vercel) site.
adelle reported it on feb 23. I was able to duplicate the error in prod that day. today, I saw it in local dev too.

once I clicked "sign in", I was redirected to the supplier's marketplace on scientist.com. I was able to log in, but the redirect erred. it took me to the nextauth default login page with a "Try signing in with a different account." message. clicking "Sign in with beachsidebiotech" didn't work. the reload button next to the url bar spun like it was trying to go somewhere, but once it finished we never left the page. going back to the homepage still showed that I wasn't signed in.

the server logs show the error below:

[next-auth][error][OAUTH_CALLBACK_HANDLER_ERROR]
https://next-auth.js.org/errors#oauth_callback_handler_error Request failed with status code 404 {
  message: 'Request failed with status code 404',
  stack: 'AxiosError: Request failed with status code 404\n' +
    '    at settle (file:///Users/alishaevn/Work/webstore/node_modules/axios/lib/core/settle.js:19:12)\n' +
    '    at Unzip.handleStreamEnd (file:///Users/alishaevn/Work/webstore/node_modules/axios/lib/adapters/http.js:512:11)\n' +
    '    at Unzip.emit (node:events:525:35)\n' +
    '    at Unzip.emit (node:domain:489:12)\n' +
    '    at endReadableNT (node:internal/streams/readable:1359:12)\n' +
    '    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)',
  name: 'AxiosError'
}
browser error image

alishaevn added a commit that referenced this issue Feb 28, 2024
the `signIn` function from "next-auth/react" uses `fetcher` and returns
a 404 error response. throwing that error causes an `OAUTH_CALLBACK_HANDLER_ERROR`,
which prevents users from signing in. `signIn` doesn't pass a url to `fetcher`.
the check below ensures that other errors still get thrown

- ref: #321
@alishaevn alishaevn linked a pull request Feb 28, 2024 that will close this issue
@alishaevn alishaevn self-assigned this Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant