Hi
currently the type of user in useAuth store is any
it would be nice if we could pass in our user type using a second parameter like AuthenticateData:
// src/stores/auth.ts
import { acceptHMRUpdate, defineStore } from 'pinia'
import { useAuth } from 'feathers-pinia'
import type { MyUser } from './somewhere'
interface AuthenticateData {
strategy: 'jwt' | 'local';
accessToken?: string;
email?: string;
password?: string;
}
export const useAuthStore = defineStore('auth', () => {
const { api } = useFeathers()
const utils = useAuth<AuthenticateData, MyUser>({ api }) // <----------- what I mean
utils.reAuthenticate()
return { ...utils }
})
Also it would be nice if you also export AuthenticateData, as I am adding a otpToken, and I find it nicer if I could just extend it's type instead of copying and editing it :)
Hi currently the type of user in useAuth store is
any
it would be nice if we could pass in our user type using a second parameter likeAuthenticateData
:Also it would be nice if you also export
AuthenticateData
, as I am adding aotpToken
, and I find it nicer if I could just extend it's type instead of copying and editing it :)