Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
handleLogin = () => {
socket.emit('login', {
username: this.loginUsername.getValue(),
password: this.loginPassword.getValue(),
os: platform.os.family,
browser: platform.name,
environment: platform.description,
}, (res) => {
if (typeof res === 'string') {
Message.error(res);
} else {
action.setUser(res);
action.closeLoginDialog();
window.localStorage.setItem('token', res.token);
}
});
}
private initConnection() {
const getConfig = new API.help.GetConfig();
const initConnection = new API.InitConnection(
new TLInt(this.apiId),
new TLString(platform.name || "Web"),
new TLString(platform.os ?
platform.os.family + " " + platform.os.version :
"Unknown"),
new TLString(VERSION),
new TLString(navigator.language),
getConfig,
);
const invokeWithLayer = new API.InvokeWithLayer(
new TLInt(API.layer),
initConnection);
this.send(invokeWithLayer, result => {
if (result instanceof API.Config) {
this.dcId = result.thisDc.value;
this.configSubject.next(result);
this.dcOptionsSubject.next(result.dcOptions.items);
this.worker.postMessage({
function _getTokenNote() {
return slug(`hubpress-${platform.name}-${platform.os}`);
}
const _isWindows = (): boolean => platform.os.family && platform.os.family.includes(PLATFORM_NAME.WINDOWS);
<div>
<div>Version</div>
<div>{platform.version}</div>
</div>
<div>
<div>Manufacturer</div>
<div>{platform.manufacturer}</div>
</div>
<div>
<div>Layout</div>
<div>{platform.layout}</div>
</div>
<div>
<div>OS</div>
<div title="{platform.os}">{platform.os.toString()}</div>
</div>
<div>
<div>Description</div>
<div>{platform.description}</div>
</div>
{
device.data.map((item, index) => {
return (
<div>
<div>
<div>{(index + 1) + '. ' + item.NodeName}</div>
</div>
<div>
<div>Node ID</div></div></div>
function getPlatformData() {
return {
clientRuntimeName: platform.name,
clientRuntimeVersion: platform.version,
clientOsName: platform.os.name,
clientOsVersion: platform.os.version
};
}
decryptProvision: function(envelopeDecoded) {
const messageStr = signalProtocol.decryptProvision(this.keyPair.priv, envelopeDecoded)
if (!messageStr) {
this.showRetry = true
return
}
const message = JSON.parse(messageStr)
const keyPair = signalProtocol.createKeyPair(message.identity_key_private)
const code = message.provisioning_code
const userId = message.user_id
const primarySessionId = message.session_id
const platform = 'Desktop'
const purpose = 'SESSION'
const platformVersion = platformInfo.os.toString()
const appVersion = this.$electron.remote.app.getVersion()
const registrationId = signalProtocol.generateRegId()
const sessionKeyPair = new Bot().generateSessionKeypair()
clearSignal()
accountAPI
.verifyProvisioning({
code: code,
user_id: userId,
session_id: primarySessionId,
platform: platform,
platform_version: platformVersion,
app_version: appVersion,
purpose: purpose,
registration_id: registrationId,
session_secret: sessionKeyPair.public
})
if (this.bypass)
return this.done();
if (!audioContext) {
if (os === 'ios') {
msg = this.messages.iosVersion;
} else if (os === 'android') {
msg = this.messages.androidVersion;
} else {
msg = this.messages.wrongOS;
}
} else if (!isMobile || client.platform.os === 'other') {
msg = this.messages.wrongOS;
} else if (client.platform.os === 'ios' && platform.os.version < '7') {
msg = this.messages.iosVersion;
} else if (client.platform.os === 'android' && platform.os.version < '4.2') {
msg = this.messages.androidVersion;
}
if (msg !== null) {
this.setCenteredViewContent(this.prefix + '<p>' + msg + '</p>' + this.postfix);
} else {
this.done();
}
}
function getPlatformData() {
return {
clientRuntimeName: platform.name,
clientRuntimeVersion: platform.version,
clientOsName: platform.os.name,
clientOsVersion: platform.os.version
};
}