Skip to content

Commit

Permalink
Add @discardableResult to some methods (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
grdsdev authored Jun 13, 2022
1 parent 4e22c94 commit d4e0cb7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Sources/GoTrue/GoTrueClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public final class GoTrueClient {
url: url, headers: headers, keychainAccessGroup: keychainAccessGroup, configuration: { _ in })
}

@discardableResult
public func signUp(email: String, password: String) async throws -> SessionOrUser {
await Current.sessionManager.remove()
let response = try await Current.client.send(
Expand All @@ -51,6 +52,7 @@ public final class GoTrueClient {
return response
}

@discardableResult
public func signUp(phone: String, password: String) async throws -> SessionOrUser {
await Current.sessionManager.remove()
let response = try await Current.client.send(
Expand All @@ -65,6 +67,7 @@ public final class GoTrueClient {
return response
}

@discardableResult
public func signIn(email: String, password: String) async throws -> Session {
await Current.sessionManager.remove()

Expand All @@ -86,6 +89,7 @@ public final class GoTrueClient {
}
}

@discardableResult
public func signIn(phone: String, password: String) async throws -> Session {
await Current.sessionManager.remove()

Expand Down Expand Up @@ -170,6 +174,7 @@ public final class GoTrueClient {
}
}

@discardableResult
public func session(from url: URL) async throws -> Session {
guard let components = URLComponents(url: url, resolvingAgainstBaseURL: false) else {
throw URLError(.badURL)
Expand Down Expand Up @@ -222,6 +227,7 @@ public final class GoTrueClient {
authEventChangeSubject.send(.signedOut)
}

@discardableResult
public func verifyOTP(params: VerifyOTPParams) async throws -> SessionOrUser {
let response = try await Current.client.send(Paths.verify.post(params)).value

Expand All @@ -233,6 +239,7 @@ public final class GoTrueClient {
return response
}

@discardableResult
public func update(user: UserAttributes) async throws -> User {
var session = try await Current.sessionManager.session()
let user = try await Current.client.send(
Expand Down

0 comments on commit d4e0cb7

Please sign in to comment.