Skip to content

Commit bc68e0b

Browse files
committed
fix crash
1 parent e1b3931 commit bc68e0b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

hocs/withAuth.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { useRouter } from 'next/router'
2-
// import get from 'lodash/get'
2+
import get from 'lodash/get'
33

4-
const withAuth = (WrappedComponent, { loginRequired = true }) => {
4+
const withAuth = (WrappedComponent, props) => {
55
return (props) => {
66
// checks whether we are on client / browser or server.
77
if (typeof window !== 'undefined') {
88
const Router = useRouter()
9+
const loginRequired = get(props, 'loginRequired', true)
910

1011
const accessToken = localStorage.getItem('feathers-jwt')
1112

0 commit comments

Comments
 (0)