Skip to content

Commit

Permalink
Move session check inside do/catch block
Browse files Browse the repository at this point in the history
  • Loading branch information
grdsdev committed Dec 6, 2023
1 parent bc04d91 commit 40b3688
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/GoTrue/GoTrueClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -591,10 +591,10 @@ public actor GoTrueClient {
/// If using ``SignOutScope/others`` scope, no ``AuthChangeEvent/signedOut`` event is fired.
/// - Parameter scope: Specifies which sessions should be logged out.
public func signOut(scope: SignOutScope = .global) async throws {
// Make sure we have a valid session.
_ = try await sessionManager.session()

do {
// Make sure we have a valid session.
_ = try await sessionManager.session()

try await api.authorizedExecute(
.init(
path: "/logout",
Expand Down

0 comments on commit 40b3688

Please sign in to comment.