1fff05b8 by Jabis Sevón

user creation stuff

1 parent af095df8
...@@ -87,11 +87,11 @@ server.on("upgrade", async function(request, socket, head) { ...@@ -87,11 +87,11 @@ server.on("upgrade", async function(request, socket, head) {
87 let obj = {roomname:roomname,creator:creator,socket:{}}; 87 let obj = {roomname:roomname,creator:creator,socket:{}};
88 if(sig) { 88 if(sig) {
89 let user = g.user(); 89 let user = g.user();
90 user.create(username,sig,async function(ack){ 90 user.create(roomname,sig,async function(ack){
91 console.log("We've got ack",ack); 91 console.log("We've got ack",ack);
92 if(ack.err){ console.log("error in user.create",ack.err); } 92 if(ack.err){ console.log("error in user.create",ack.err); }
93 let auth = await new Promise ((res,rej)=>{ 93 let auth = await new Promise ((res,rej)=>{
94 return user.auth(username,sig,res); 94 return user.auth(roomname,sig,res);
95 }); 95 });
96 if(auth.err){ console.log('error in auth',auth.err); } 96 if(auth.err){ console.log('error in auth',auth.err); }
97 console.log("auth",auth); 97 console.log("auth",auth);
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!