auth.ts 376 B

123456789101112
  1. import { acceptHMRUpdate, defineStore } from 'pinia'
  2. import { api } from '@/feathers'
  3. import { useAuth } from 'feathers-pinia'
  4. export const useAuthStore = defineStore('auth', () => {
  5. const auth = useAuth({ api, servicePath: 'users' });
  6. auth.reAuthenticate();
  7. return auth;
  8. })
  9. if (import.meta.hot)
  10. import.meta.hot.accept(acceptHMRUpdate(useAuthStore, import.meta.hot))