diff --git a/Sources/Auth/AuthClient.swift b/Sources/Auth/AuthClient.swift index f7f67efb..8dafe49b 100644 --- a/Sources/Auth/AuthClient.swift +++ b/Sources/Auth/AuthClient.swift @@ -693,6 +693,13 @@ public final class AuthClient: Sendable { return session } + + /// Resets the session without sending a singout request to the server. + public func resetSession() async { + await sessionManager.remove() + eventEmitter.emit(.signedOut, session: nil) + } + /// Signs out the current user, if there is a logged in user. /// /// If using ``SignOutScope/others`` scope, no ``AuthChangeEvent/signedOut`` event is fired. @@ -722,8 +729,7 @@ public final class AuthClient: Sendable { } if scope != .others { - await sessionManager.remove() - eventEmitter.emit(.signedOut, session: nil) + await self.resetSession() } }