Skip to content

Commit

Permalink
Merge branch 'master' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-tennert committed Oct 22, 2023
2 parents 9e13178 + 7ca8011 commit 767c934
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,23 @@ internal class GoTrueImpl(
config: (Config.() -> Unit)?
): SSO.Result {
val createdConfig = type.config.apply { config?.invoke(this) }
var codeChallenge: String? = null
if (this.config.flowType == FlowType.PKCE) {
val codeVerifier = generateCodeVerifier()
codeVerifierCache.saveCodeVerifier(codeVerifier)
codeChallenge = generateCodeChallenge(codeVerifier)
}
return api.postJson("sso", buildJsonObject {
redirectUrl?.let { put("redirect_to", it) }
createdConfig.captchaToken?.let {
put("gotrue_meta_security", buildJsonObject {
put("captcha_token", it)
})
}
codeChallenge?.let {
put("code_challenge", it)
put("code_challenge_method", "s256")
}
when (createdConfig) {
is SSO.Config.Domain -> put("domain", createdConfig.domain)
is SSO.Config.Provider -> put("provider_id", createdConfig.providerId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ data object LinkedIn : OAuthProvider() {

}

data object LinkedInOIDC : OAuthProvider() {

override val name = "linkedin_oidc"

}

data object Notion : OAuthProvider() {

override val name = "notion"
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ kotlin.mpp.applyDefaultHierarchyTemplate=true
org.jetbrains.compose.experimental.uikit.enabled=true
org.jetbrains.compose.experimental.jscanvas.enabled=true

supabase-version = 1.4.3
supabase-version = 1.4.4

0 comments on commit 767c934

Please sign in to comment.