MFA support
This commit is contained in:
17
lib/classes/LoginError.ts
Normal file
17
lib/classes/LoginError.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
export class LoginError extends Error
|
||||
{
|
||||
public reason: string;
|
||||
public message_id: string;
|
||||
|
||||
public constructor(err: {
|
||||
login: 'false',
|
||||
reason: string,
|
||||
message: string,
|
||||
message_id: string
|
||||
})
|
||||
{
|
||||
super(err.message);
|
||||
this.reason = err.reason;
|
||||
this.message_id = err.message_id;
|
||||
}
|
||||
}
|
||||
@@ -5,4 +5,6 @@ export class LoginParameters
|
||||
password: string;
|
||||
start = 'last';
|
||||
url = 'https://login.agni.lindenlab.com/cgi-bin/login.cgi';
|
||||
token?: string;
|
||||
mfa_hash?: string;
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ export class LoginResponse
|
||||
'moonTextureID'?: UUID,
|
||||
} = {};
|
||||
searchToken: string;
|
||||
mfaHash?: string;
|
||||
clientEvents: ClientEvents;
|
||||
|
||||
private static toRegionHandle(x_global: number, y_global: number): Long
|
||||
@@ -121,7 +122,6 @@ export class LoginResponse
|
||||
this.clientEvents = clientEvents;
|
||||
this.agent = new Agent(this.clientEvents);
|
||||
this.region = new Region(this.agent, this.clientEvents, options);
|
||||
|
||||
if (json['agent_id'])
|
||||
{
|
||||
this.agent.agentID = new UUID(json['agent_id']);
|
||||
@@ -218,6 +218,9 @@ export class LoginResponse
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'mfa_hash':
|
||||
this.mfaHash = String(val);
|
||||
break;
|
||||
case 'search_token':
|
||||
this.searchToken = String(val);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user