-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Added client_id to micropubDocument #10
base: main
Are you sure you want to change the base?
Conversation
Added a variable that carries the client_id through from the token authorization step to the micropubDocument.
I've verified that the client_id passthrough works. This code is currently running on production of https://eddiehinkle.com and successfully marking my checkin posts as having the client_id of https://ownyourswarm.p3k.io in my output file. |
I see the test wants to force all variables to be const or let. I don't know enough about the nuances between const, let and var to know if the way that I'm using micropubClientId could be changed to a let. From what I understand, it would cause an error. Basically the issue is capturing the variable on line 243 and then using it on line 349 which are in completely different functions and blocks. So I'll leave the thinking through of the no-var test and the implementation up to you all. |
On the issue of Regarding the PR in itself though: I'm afraid it doesn't work assigning the value as you do. The reason it doesn't work is the asynchronous nature of Node.js. Multiple incoming requests can be processed at once and a subsequent requests can thus have it's The correct way to pass the value would be to have node-micropub-express/index.js Line 310 in 699da7d
There the currently boolean On the topic of the |
Ohhh, I see what you're talking about in regards to the multiple requests and losing the value. When I have some time, I'll look through adapting this to work correctly. My current solution will work for me in the short term as I'm only using micropub with OwnYourSwarm and Teacup so the likelihood of them happening near the same time is almost none. However, I do plan on expanding my micropub support fairly quickly so I'll need to fix that glitch on my site as well before that kicks my site. As far as That is my eventual goal as well, to be able to show what application I used to make the post that a user is looking at. There is more about it here: https://indieweb.org/obtaining-an-access-token#Token_Endpoint |
Added a variable that carries the client_id through from the token authorization step to the micropubDocument.