Skip to content

Commit

Permalink
Mike/custom oauth providers (#120)
Browse files Browse the repository at this point in the history
* custom case for oauth provider

* add option for additional scopes when creating external account

* remove named param from custom oauth strategy

* use static image url for apple, dynamic otherwise

* fix computed prover name var

* move empty check to first where

* fix find and replace name swap

* add comment
  • Loading branch information
mikepitre authored Aug 21, 2024
1 parent 158c2f0 commit c0a2b9d
Show file tree
Hide file tree
Showing 15 changed files with 244 additions and 197 deletions.
2 changes: 2 additions & 0 deletions Sources/API/Models/Environment/UserSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ extension Clerk.Environment {
public let authenticatable: Bool
public let strategy: String
public let notSelectable: Bool
public let name: String
public let logoUrl: String?
}

public struct Actions: Codable, Equatable, Sendable {
Expand Down
5 changes: 3 additions & 2 deletions Sources/API/Models/ExternalAccount.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,15 @@ extension ExternalAccount: Comparable {
if lhs.verification?.status != rhs.verification?.status {
return lhs.verification?.status == .verified
} else {
return (lhs.socialProvider?.providerData.name ?? "") < (rhs.socialProvider?.providerData.name ?? "")
return lhs.oauthProvider.strategy < rhs.oauthProvider.strategy
}
}
}

extension ExternalAccount {

var socialProvider: OAuthProvider? {
var oauthProvider: OAuthProvider {
// provider on an external account is the strategy value
.init(strategy: provider)
}

Expand Down
Loading

0 comments on commit c0a2b9d

Please sign in to comment.