1
0
mirror of https://github.com/sasjs/adapter.git synced 2025-12-11 01:14:36 +00:00

fix: deriving username with full name

This commit is contained in:
Saad Jutt
2021-09-06 12:52:40 +05:00
parent 3ccd35a4e2
commit 351a22cb3c

View File

@@ -176,11 +176,12 @@ export class AuthManager {
switch (this.serverType) {
case ServerType.SasViya:
return response?.id
case ServerType.Sas9:
const matched = response?.match(/"title":"Log Off [0-1a-zA-Z ]*"/)
const username = matched?.[0].slice(17, -1)
if (username.length === 6) return username
if (!username.includes(' ')) return username
return username
.split(' ')