CORS error for a Firebase Extension "Authenticate with Stream Chat" Function on localhost (Angular)
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- angular, typescript
Research direction
Start with the Angular httpsCallable invocation of the getStreamUserToken Firebase function and inspect how the extension's callable endpoint handles requests from http://localhost:4200. Compare the browser's preflight failure with the function configuration; done means the function can be called from localhost without the reported CORS error.
Written by the indexing model from the issue text.
Description
In summary, I'm trying to use an extension called "Authenticate with Stream Chat." Inside the extension, there are several functions. One of them is an onCall function called "getStreamUserToken" which returns the user token. Here's how I'm calling it from the client side:
getStreamToken() { const result = httpsCallable( this.functions, 'getStreamUserToken' ); result({}).then((response) => { console.log(response.data); }); }
However, I'm encountering the following error:
Access to fetch at 'https://us-central1-project.cloudfunctions.net/getStreamUserToken' from origin 'http://localhost:4200' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
I understand that this is a CORS error, and I'd like to resolve it.
Please, I've been stuck here for weeks. Thanks in advance!
- Dominant language
- TypeScript
- Stars
- 18
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from GetStream/stream-firebase-extensions
-
Difficulty 1/5 1-3 hours Newbie friendliness 72/100
GetStream/stream-firebase-extensions#713 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 64/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
All issues in GetStream/stream-firebase-extensions
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
siyuan-note/siyuan#21692 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
GetStream/stream-chat-react#3467 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
resend/resend-node#1206 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
cloudflare/cloudflare-typescript#2821 ·