-
{{banner.join('\n')}}
{{user.join('\n')}}
+
{{banner.join('\n')}}
{{authinfo.greeting.join('\n').replace(/^\n+|\s+$/gm, '')}}
{{user.join('\n')}}
@@ -142,11 +142,22 @@
},
async login(evt) {
if(this.x_client) {
- this.authinfo = await ((this.accesscode && this.verifycode) ? this.x_client.authenticate(this.accesscode + ';' + this.verifycode) : this.x_client.authenticate());
- if(this.authinfo.duz) {
- var user = await this.x_client.XUS_GET_USER_INFO();
- this.x_user = user[0] ? user : null
- } else this.x_user = null;
+ try {
+ this.authinfo = await ((this.accesscode && this.verifycode) ? this.x_client.authenticate(this.accesscode + ';' + this.verifycode) : this.x_client.authenticate());
+ if(this.authinfo.duz) {
+ var user = await this.x_client.XUS_GET_USER_INFO();
+ this.x_user = user[0] ? user : null
+ } else {
+ this.x_user = null;
+ if(this.authinfo.message) window.alert(this.authinfo.message);
+ else window.alert('Authentication failed.');
+ }
+ } catch(ex) {
+ this.authinfo = this.x_user = null;
+ console.warn(ex);
+ if(ex.name) window.alert(ex.name);
+ else window.alert('Authentication failed.');
+ }
this.$emit('update:user', this.x_user);
this.show = !this.x_user;
this.$emit('update:server', this.x_server = (await this.x_client.serverinfo()).result);