Closed neilyoung closed 4 years ago
OK, figured it out:
const repos = new Server(path.resolve(__dirname, 'tmp'), {
autoCreate: true,
authenticate: ({ type, repo, user, headers }, next) => {
user((username, password) => {
console.log(username, password);
if (username == "foo" && password == "bar")
next()
else
next("authentication failed")
});
}
});
This definitely needs more doc
But it works well :)
In your examples you are not too specific how your authenticate function is supposed to work.
You are just tracing the username/password and proceed.
What am I supposed to do in order to achieve a proper authentication? So far I tried this:
Server
The client calls this like so:
I'm getting asked client side for username/password, enter that, but get a rejection. Server side this is logged:
push what undefined undefined