mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-05-07 18:46:41 +07:00
removed redux completely
This commit is contained in:
parent
26e6d8d41b
commit
a4bb07e9cf
323 changed files with 2464 additions and 3348 deletions
20
src/hooks/auth/useAuth.ts
Normal file
20
src/hooks/auth/useAuth.ts
Normal file
|
@ -0,0 +1,20 @@
|
|||
import { useUser } from '~/hooks/auth/useUser';
|
||||
import { useAuthStore } from '~/store/auth/useAuthStore';
|
||||
import { useLoginLogoutRestore } from '~/hooks/auth/useLoginLogoutRestore';
|
||||
|
||||
export const useAuth = () => {
|
||||
const { user } = useUser();
|
||||
const auth = useAuthStore();
|
||||
|
||||
const { login, logout } = useLoginLogoutRestore();
|
||||
|
||||
return {
|
||||
user,
|
||||
logout,
|
||||
login,
|
||||
isUser: auth.isUser,
|
||||
setToken: auth.setToken,
|
||||
isTester: auth.isTester,
|
||||
setIsTester: auth.setIsTester,
|
||||
};
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue