celi auth compatibility
							parent
							
								
									09246c786d
								
							
						
					
					
						commit
						2daf1c876d
					
				|  | @ -21,7 +21,7 @@ async function auth() { | |||
| 		}, callback); | ||||
| 
 | ||||
| 	window.signedMessage = await openpgp.sign({ | ||||
| 		message: new openpgp.CleartextMessage('vybe_auth ' + window.session, ''), | ||||
| 		message: new openpgp.CleartextMessage(window.session, ''), | ||||
| 		signingKeys: window.keys.priv | ||||
| 	}); | ||||
| 
 | ||||
|  |  | |||
|  | @ -85,13 +85,6 @@ async function authenticate(msg, respond, socket) { | |||
| 			expectSigned: true, | ||||
| 			date: new Date(Date.now() + 60000 * 4) // slightly in the future to compensate for some system clocks
 | ||||
| 		}); | ||||
| 		const data = verification.data.split(' '); | ||||
| 		if (data[0] !== 'vybe_auth') { | ||||
| 			return respond({ | ||||
| 				success: false, | ||||
| 				message: 'bad auth message' | ||||
| 			}); | ||||
| 		} | ||||
| 		if (vybe.instance.url === id[1] || (!vybe.instance.url && !id[0])) { | ||||
| 			// this should be user's home instance
 | ||||
| 			user = await getUser(id[0], msg.name); | ||||
|  | @ -176,7 +169,7 @@ async function authenticate(msg, respond, socket) { | |||
| 			sockets: [], | ||||
| 			authrequests: {} | ||||
| 		}); | ||||
| 		socket.__auth = data[1]; | ||||
| 		socket.__auth = verification.data; | ||||
| 		socket.__userid = user.id; | ||||
| 		user.sockets.push(socket); | ||||
| 		respond({ | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue