Skip to content

Commit d83f681

Browse files
Add remember option to loginUser
gotrue-js specifies a third argument: remember. This argument is necessary to keep users logged in after a page refresh.
1 parent 60a9cd2 commit d83f681

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/index.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ export function useNetlifyIdentity(domain: string, onAuthChange: authChangeParam
2929
// make sure the Registration preferences under Identity settings in your Netlify dashboard are set to Open.
3030
const signupUser = (email: string, password: string, data: Object) =>
3131
goTrueInstance.signup(email, password, data).then(_setUser) // TODO: make setUser optional?
32-
const loginUser = (email: string, password: string) => goTrueInstance.login(email, password).then(_setUser)
32+
const loginUser = (email: string, password: string, remember: boolean) =>
33+
goTrueInstance.login(email, password, remember).then(_setUser)
3334
const requestPasswordRecovery = (email: string) => goTrueInstance.requestPasswordRecovery(email)
3435
const recoverAccount = (token: string, remember?: boolean | undefined) => goTrueInstance.recover(token, remember)
3536
const updateUser = (fields: Object) => {

0 commit comments

Comments
 (0)