Clean up auth.vue
This commit is contained in:
parent
e2ebe83238
commit
5e79069c4a
|
@ -89,9 +89,7 @@ export default defineComponent({
|
||||||
const isMastodon = !!getUrlParams().mastodon
|
const isMastodon = !!getUrlParams().mastodon
|
||||||
if (this.session.app.callbackUrl && isMastodon) {
|
if (this.session.app.callbackUrl && isMastodon) {
|
||||||
const stateParam = !!getUrlParams().state ? `&state=$(getUrlParams().state)` : '';
|
const stateParam = !!getUrlParams().state ? `&state=$(getUrlParams().state)` : '';
|
||||||
const tokenRaw = this.session.token
|
location.href = `${this.session.app.callbackUrl}?code=${this.session.token}${stateParam}`;
|
||||||
const token = tokenRaw.replaceAll('-', '')
|
|
||||||
location.href = `${this.session.app.callbackUrl}?code=${tokenRaw}${stateParam}`;
|
|
||||||
} else if (this.session.app.callbackUrl) {
|
} else if (this.session.app.callbackUrl) {
|
||||||
const url = new URL(this.session.app.callbackUrl);
|
const url = new URL(this.session.app.callbackUrl);
|
||||||
if (['javascript:', 'file:', 'data:', 'mailto:', 'tel:'].includes(url.protocol)) throw new Error('invalid url');
|
if (['javascript:', 'file:', 'data:', 'mailto:', 'tel:'].includes(url.protocol)) throw new Error('invalid url');
|
||||||
|
|
Loading…
Reference in New Issue