Strip out @acct@ from instance URL when log in

pull/54/head
Lim Chee Aun 2023-02-01 10:49:42 +08:00
rodzic 3d2b7f683c
commit 20e569da0c
1 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -40,7 +40,9 @@ function Login() {
const { elements } = e.target;
let instanceURL = elements.instanceURL.value.toLowerCase();
// Remove protocol from instance URL
instanceURL = instanceURL.replace(/(^\w+:|^)\/\//, '');
instanceURL = instanceURL.replace(/^https?:\/\//, '').replace(/\/+$/, '');
// Remove @acct@ or acct@ from instance URL
instanceURL = instanceURL.replace(/^@?[^@]+@/, '');
store.local.set('instanceURL', instanceURL);
(async () => {