Strip out @acct@ from instance URL when log in

This commit is contained in:
Lim Chee Aun 2023-02-01 10:49:42 +08:00
parent 3d2b7f683c
commit 20e569da0c

View file

@ -40,7 +40,9 @@ function Login() {
const { elements } = e.target; const { elements } = e.target;
let instanceURL = elements.instanceURL.value.toLowerCase(); let instanceURL = elements.instanceURL.value.toLowerCase();
// Remove protocol from instance URL // 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); store.local.set('instanceURL', instanceURL);
(async () => { (async () => {