petersalomonsen / wasm-git

GIT for nodejs and the browser using https://libgit2.org compiled to WebAssembly with https://emscripten.org
Other
647 stars 37 forks source link

How can I use my credentials to clone/pull/push to a private repo? #92

Closed yxshv closed 9 months ago

yxshv commented 9 months ago

Is there any way, I can give it my github access token?

yxshv commented 9 months ago

I found this https://github.com/petersalomonsen/wasm-git/issues/72#issuecomment-1460483790 , but i don think XMLHttpRequest are used in nodejs

yxshv commented 9 months ago

I tried add interceptors using @mswjs/interceptors but it didn't work :/

yxshv commented 9 months ago

I got it working...

I had to edit the lg2.js file to manually set an Authorization header from a environmental variables... and it worked

but there should be a better way...?

petersalomonsen commented 9 months ago

You don't need to edit lg2.js manually. Take a look at how it is done here: https://github.com/petersalomonsen/githttpserver/blob/master/public/libgit2_webworker.js#L17

yxshv commented 9 months ago

You don't need to edit lg2.js manually. Take a look at how it is done here: https://github.com/petersalomonsen/githttpserver/blob/master/public/libgit2_webworker.js#L17

well now, I forked it and build it on my own

thanks tho :)