diff --git a/client/src/pages/login/useLogin.native.test.tsx b/client/src/pages/login/useLogin.native.test.tsx index 136f97353..61d36363a 100644 --- a/client/src/pages/login/useLogin.native.test.tsx +++ b/client/src/pages/login/useLogin.native.test.tsx @@ -66,10 +66,11 @@ afterEach(() => { }); describe('useLogin in the native app', () => { - it('FE-LOGIN-NATIVE-001: reports that it runs in the app', async () => { + it('FE-LOGIN-NATIVE-001: reports that it runs in the app and remembers the login by default', async () => { const { result } = renderLogin(); await waitFor(() => expect(result.current.appConfig).not.toBeNull()); expect(result.current.nativeApp).toBe(true); + expect(result.current.rememberMe).toBe(true); }); it('FE-LOGIN-NATIVE-002: does not bounce an OIDC-only install to the IdP inside the WebView', async () => { diff --git a/client/src/pages/login/useLogin.ts b/client/src/pages/login/useLogin.ts index 2fa48ed4e..bb914d42c 100644 --- a/client/src/pages/login/useLogin.ts +++ b/client/src/pages/login/useLogin.ts @@ -43,7 +43,9 @@ export function useLogin() { const [username, setUsername] = useState('') const [email, setEmail] = useState('') const [password, setPassword] = useState('') - const [rememberMe, setRememberMe] = useState(false) + // On by default in the app: a session cookie there dies with the app process, + // and nobody expects to sign in again every time the phone unloads an app. + const [rememberMe, setRememberMe] = useState(isNativeApp) const [showPassword, setShowPassword] = useState(false) const [isLoading, setIsLoading] = useState(false) const [error, setError] = useState('')