Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Sources/OAuthKit/OAuth.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,15 @@ public extension OAuth {
state = .authorizing(provider, grantType)
case .deviceCode:
state = .requestingDeviceCode(provider)
Task(priority: .high) {
Task.immediate {
await requestDeviceCode(provider: provider)
}
case .clientCredentials:
Task(priority: .high) {
Task.immediate {
await requestClientCredentials(provider: provider)
}
case .refreshToken:
Task(priority: .high) {
Task.immediate {
await refreshToken(provider: provider)
}
}
Expand All @@ -138,7 +138,7 @@ public extension OAuth {
/// - code: the code to exchange
/// - pkce: the pkce data
func token(provider: Provider, code: String, pkce: PKCE? = nil) {
Task(priority: .high) {
Task.immediate {
await requestToken(provider: provider, code: code, pkce: pkce)
}
}
Expand Down Expand Up @@ -242,7 +242,7 @@ private extension OAuth {
if context.canEvaluatePolicy(policy, error: &error) {
context.evaluatePolicy(policy, localizedReason: localizedReason) { [weak self] success, error in
guard let self else { return }
Task(priority: .high) { @MainActor in
Task.immediate { @MainActor in
if success {
self.loadAuthorizations()
}
Expand Down Expand Up @@ -309,7 +309,7 @@ private extension OAuth {
tasks.append(task)
} else {
// Execute the task immediately
Task(priority: .high) {
Task.immediate {
await refreshToken(provider: provider)
}
}
Expand Down