mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-20 05:56:53 +00:00
fix(native): remember the login by default inside the app
With the switch off the app got a session cookie, which dies with the app process, so every time the phone unloaded TREK the user had to sign in again. Found while running the Android build in the emulator.
This commit is contained in:
@@ -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 () => {
|
||||
|
||||
@@ -43,7 +43,9 @@ export function useLogin() {
|
||||
const [username, setUsername] = useState<string>('')
|
||||
const [email, setEmail] = useState<string>('')
|
||||
const [password, setPassword] = useState<string>('')
|
||||
const [rememberMe, setRememberMe] = useState<boolean>(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<boolean>(isNativeApp)
|
||||
const [showPassword, setShowPassword] = useState<boolean>(false)
|
||||
const [isLoading, setIsLoading] = useState<boolean>(false)
|
||||
const [error, setError] = useState<string>('')
|
||||
|
||||
Reference in New Issue
Block a user