Lemmy 0.19 changes auth from form parameter to header, been tinkering with photon code changes #152
MusicSongs-Org
started this conversation in
Ideas
Replies: 1 comment
-
In the comments of the same gist, https://gist.github.com/MusicSongs-Org/1a9bc61db386bec835f679f877428f6d I've shared a diff with today's photon source to do this without having to replace all the calls. Thank you. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, thanks again for Photon.
Lemmy 0.19 changes where the JWT auth token goes, now in the HTTP header. There is no backwards compatibility so far.
I've been running
"lemmy-js-client": "0.19.0-rc.12"
trying to figure out what needs changed in photon. The good news is that you can keep the original 'auth:' in place with the newer library, TypeScript will complain, but it at least gives some way to try and keep the source code compatible with 0.18 and 0.19 conventions.I'm terrible with all the variations of RegEx, and I couldn't figure out how to get the sed syntax right. So I created a NodeJS script to rewrite the .svelte source code files:
https://gist.github.com/MusicSongs-Org/1a9bc61db386bec835f679f877428f6d
It runs in 4 passes, you have to manually change the variable for the switch/case. I can toss out my local tree and get latest photon changes and re-apply the edits. There are still some spots it does not get I assume, but most is working.
For some reason I haven't been able to getSite() to return my_user for a logged-in account. It's the only API call so far that I've had trouble with. I resorted to using a direct NodeJS fetch call to the Lemmy API endpoint as a temporary workaround. That isn't in the gist code.
Beta Was this translation helpful? Give feedback.
All reactions