updated sdk to ^0.3.0

This commit is contained in:
Gani Georgiev
2022-08-02 17:00:14 +03:00
parent 8268c26d8b
commit a049a37624
47 changed files with 246 additions and 245 deletions
+4 -3
View File
@@ -12,7 +12,7 @@ import { setAdmin } from "@/stores/admin";
* @param {Boolean} [redirect] Whether to redirect to the login page.
*/
PocketBase.prototype.logout = function(redirect = true) {
this.AuthStore.clear();
this.authStore.clear();
if (redirect) {
replace('/login');
@@ -81,6 +81,7 @@ class AppAuthStore extends LocalAuthStore {
*/
clear() {
super.clear();
setAdmin(null);
}
}
@@ -91,8 +92,8 @@ const client = new PocketBase(
new AppAuthStore("pb_admin_auth")
);
if (client.AuthStore.model instanceof Admin) {
setAdmin(client.AuthStore.model);
if (client.authStore.model instanceof Admin) {
setAdmin(client.authStore.model);
}
export default client;