making login work for prod

This commit is contained in:
metacryst
2026-03-16 07:56:40 -05:00
parent a626abe1c3
commit 69b359d9a1
9 changed files with 81 additions and 23 deletions

View File

@@ -1,4 +1,19 @@
import { Preferences } from '@capacitor/preferences';
export default class util {
static async authFetch(url, options = {}) {
const { value: token } = await Preferences.get({ key: 'auth_token' });
return fetch(url, {
...options,
headers: {
...options.headers,
'Authorization': `Bearer ${token}`,
'X-Client': 'mobile'
}
});
}
static cssVariable(value) {
return getComputedStyle(document.documentElement)
.getPropertyValue("--" + value)