Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.
This repository was archived by the owner on Oct 10, 2025. It is now read-only.

Logout > Login sometimes restores previous credentials #34

@tristan-warner-smith

Description

@tristan-warner-smith

Describe the bug
After calling the log out API and subsequently attempting to log in again with a different email address, we're being logged in with the previous credentials not the ones entered.

To Reproduce
In code terms we're calling:

try await magic.user.getIdToken().async() // which throws
try await magic.auth.loginWithEmailOTP(.init(email: "[email protected]")).async()
// Then we log out
try await magic.user.logout().async()
// Then we go to log in with a different email address but
try await magic.user.getIdToken().async() // returns the previous token
// Which means they're logged in but with the previous email

Steps to reproduce the behavior:

  • As above

Expected behavior
Once you've called the logOut() method, subsequent calls to getIdToken will throw.

Environment

  • Package Version: 10.0.0
  • Xcode Version: 15.2, 15.3 beta
  • Swift Version: 5.9, 5.10
  • Simulator / Device OS: * Simulator + Device (iOS 17.2.1, iOS 17.4)

Additional context
Log out is an unusual operation in our app but this issue is subjectively reproducible 15-25% of the time in our testing.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions