what is "setUserClaim"? As far as I can tell it only exists in this article.
For assigning roles to users. You can read more on the firebase docs firebase.google.com/docs/auth/admi...
Seems they use setCustomUserClaims, not setUserClaim?
Thanks for pointing this out. Corrected the typo.
Thanks, also it seems like on your frontend code that firebase.initialize(config); would now be initializeApp instead of initialize; For a WebApp atleast.
firebase.initialize(config);
initializeApp
initialize
Thanks for pointing that out. Will correct it
Sorry but,
When you do: return axios.get('https://your-api-url/articles', {headers: authorization: 'Bearer '+ token})
return axios.get('https://your-api-url/articles', {headers: authorization: 'Bearer '+ token})
You missed a bracket or two, and have not put authorization into another object inside headers. It should probably be
return axios.get('https://your-api-url/articles', {headers: { authorization: 'Bearer '+ token}})
Thanks again
also, auth is a function auth().setCustomUserClaims 🙃
auth().setCustomUserClaims
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
what is "setUserClaim"? As far as I can tell it only exists in this article.
For assigning roles to users. You can read more on the firebase docs
firebase.google.com/docs/auth/admi...
Seems they use setCustomUserClaims, not setUserClaim?
Thanks for pointing this out. Corrected the typo.
Thanks, also it seems like on your frontend code that
firebase.initialize(config);
would now beinitializeApp
instead ofinitialize
;For a WebApp atleast.
Thanks for pointing that out. Will correct it
Sorry but,
When you do:
return axios.get('https://your-api-url/articles', {headers:
authorization: 'Bearer '+ token})
You missed a bracket or two, and have not put authorization into another object inside headers. It should probably be
return axios.get('https://your-api-url/articles', {headers: {
authorization: 'Bearer '+ token}})
Thanks again
also, auth is a function
auth().setCustomUserClaims
🙃