summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-ui/src/auth/hook.js
diff options
context:
space:
mode:
Diffstat (limited to 'opendc-web/opendc-web-ui/src/auth/hook.js')
-rw-r--r--opendc-web/opendc-web-ui/src/auth/hook.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/opendc-web/opendc-web-ui/src/auth/hook.js b/opendc-web/opendc-web-ui/src/auth/hook.js
index ddaf53ed..8dd85fdd 100644
--- a/opendc-web/opendc-web-ui/src/auth/hook.js
+++ b/opendc-web/opendc-web-ui/src/auth/hook.js
@@ -23,8 +23,9 @@
import { useEffect, useState } from 'react'
import { userIsLoggedIn } from './index'
import { useRouter } from 'next/router'
+import { useSelector } from 'react-redux'
-export function useAuth() {
+export function useIsLoggedIn() {
const [isLoggedIn, setLoggedIn] = useState(false)
useEffect(() => {
@@ -42,3 +43,7 @@ export function useRequireAuth() {
}
})
}
+
+export function useUser() {
+ return useSelector((state) => state.auth)
+}