tatsuyamoriguchi / Sleep-Tracer

1 stars 0 forks source link

Register button returns an error but the registration is completed. #60

Closed tatsuyamoriguchi closed 1 month ago

tatsuyamoriguchi commented 1 month ago
  1. Press "Register" button on Login view.
  2. Enter the credential information, then press Register button.
  3. Returns: "User registred with email: test1@test.com and password: test1 Hello Issue in AuthenticationManager.shared.register(email: email, password: password, confirmPassword)"

"User registered with email: test1@test.com and password: test1" indicated the registration was completed. Why am I getting "Issue in AuthenticationManager.shared.register(email: email, password: password, confirmPassword)" error?

tatsuyamoriguchi commented 1 month ago

Was forgetting to uncomment "AuthenticationManager.isLoggedIn = true"

    do {
        try Keychain.save(email: email, password: password)
        **AuthenticationManager.isLoggedIn = true**
        print("User registred with email: \(email) and password: \(password)")
    } catch {
        AuthenticationManager.isLoggedIn = false
        print("Error saving user credentials: \(error.localizedDescription)")
    }
    return AuthenticationManager.isLoggedIn