Allow the usage of a different instance for authentication.

This commit is contained in:
Kavin
2022-07-21 09:34:57 +05:30
parent 7803732da6
commit 37512b4e77
13 changed files with 65 additions and 30 deletions

View File

@@ -154,8 +154,13 @@ const mixin = {
apiUrl() {
return this.getPreferenceString("instance", "https://pipedapi.kavin.rocks");
},
authApiUrl() {
if (this.getPreferenceBoolean("authInstance", false)) {
return this.getPreferenceString("auth_instance_url", this.apiUrl());
} else return this.apiUrl();
},
getAuthToken() {
return this.getPreferenceString("authToken" + this.hashCode(this.apiUrl()));
return this.getPreferenceString("authToken" + this.hashCode(this.authApiUrl()));
},
hashCode(s) {
return s.split("").reduce(function (a, b) {