pocketbase-tools
Version:
A TypeScript toolkit for PocketBase, featuring a standard service/action/types layered structure. It provides interfaces and implementations for common business logic such as users, products, company profiles, and file utilities, making it suitable for se
18 lines (17 loc) • 504 B
JavaScript
export class DefaultAuthStrategy {
constructor(client, collection = "users") {
this.client = client;
this.collection = collection;
}
async authenticate(email, password) {
return await this.client
.collection(this.collection)
.authWithPassword(email, password);
}
async refreshToken() {
return await this.client.collection(this.collection).authRefresh();
}
async logout() {
this.client.authStore.clear();
}
}