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

[BUG] Email component failing with 422 #165

Closed
PranavSathy opened this issue Nov 4, 2021 · 3 comments · Fixed by #166
Closed

[BUG] Email component failing with 422 #165

PranavSathy opened this issue Nov 4, 2021 · 3 comments · Fixed by #166

Comments

@PranavSathy
Copy link
Contributor

Describe the bug
When leveraging the nylas-email component (with id, access_token and thread_id populated), I get the following error in my application from the component:

UserInputError: 8e761915-41fa-4f08-8549-72480b200d53
      Invalid request. Your component requires an `access_token` as X-Access-Token or as `access_token` on the request body

When looking at the Network console, I see a 422 error on the URL:

https://web-components.nylas.com/middleware/threads/1f0s6qeqxz8h0taq4yy77z6go?view=expanded

To Reproduce
Simply I am using the @nylas/components-email package, with the following code:

<nylas-email
      id="8e761915-41fa-4f08-8549-72480b200d53"
      access_token={viewer.nylasEmailAccessToken}
      thread_id={props.threadId}
    ></nylas-email>

I confirmed both the threadId and nylasEmailAccessToken are populated and valid (even hard coding them).

Expected behavior
It loads all the messages in my thread.

Version:
1.0.12

@ozsivanov
Copy link
Contributor

Hi @PranavSathy, thanks for identifying this. It looks like we have a few gaps in how we're passing through access_tokens in the email / mailbox components. I'll get a fix up this morning.

@PranavSathy
Copy link
Contributor Author

Appreciate that, thank you! Happy to test the fix if you can release as well today as part of the merge!

@ozsivanov
Copy link
Contributor

I just published v1.0.13 that has the fix included - could you please verify? https://www.npmjs.com/package/@nylas/components-email

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

Successfully merging a pull request may close this issue.

2 participants