enable apple auth button
This commit is contained in:
@ -12,8 +12,7 @@ object DatastoreKeys {
|
||||
|
||||
object AppleConstants {
|
||||
const val clientId = "app.omnivore"
|
||||
const val redirectURI = "https://api-demo.omnivore.app/api/auth/vercel/apple-redirect"
|
||||
const val redirectURI = "https%3A%2F%2Fapi-demo.omnivore.app%2Fapi%2Fauth%2Fvercel%2Fapple-redirect"
|
||||
const val scope = "name%20email"
|
||||
const val authUrl = "https://appleid.apple.com/auth/authorize"
|
||||
const val tokenUrl = "https://appleid.apple.com/auth/token"
|
||||
}
|
||||
|
||||
@ -70,23 +70,13 @@ fun AppleAuthWebContainerView(onDismiss: (String?) -> Unit) {
|
||||
@Composable
|
||||
fun AppleAuthWebView(onDismiss: (String?) -> Unit) {
|
||||
val url = AppleConstants.authUrl +
|
||||
"?client_id=" +
|
||||
AppleConstants.clientId +
|
||||
"&redirect_uri=" +
|
||||
AppleConstants.redirectURI +
|
||||
"&response_type=code%20id_token&scope=" +
|
||||
AppleConstants.scope +
|
||||
"&response_mode=form_post&state=android:login"
|
||||
|
||||
// clientId="app.omnivore"
|
||||
// scope="name email"
|
||||
// state="web:login"
|
||||
// redirectURI={appleAuthRedirectURI}
|
||||
// responseMode="form_post"
|
||||
// responseType="code id_token"
|
||||
// designProp={{
|
||||
// color: 'black',
|
||||
|
||||
"?client_id=" + AppleConstants.clientId +
|
||||
"&redirect_uri=" + AppleConstants.redirectURI +
|
||||
"&response_type=code%20id_token" +
|
||||
"&scope=" + AppleConstants.scope +
|
||||
"&response_mode=form_post" +
|
||||
"&state=android:login"
|
||||
|
||||
// Adding a WebView inside AndroidView
|
||||
// with layout as full screen
|
||||
AndroidView(factory = {
|
||||
@ -95,7 +85,6 @@ fun AppleAuthWebView(onDismiss: (String?) -> Unit) {
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.MATCH_PARENT
|
||||
)
|
||||
// webViewClient = WebViewClient()
|
||||
webViewClient = object : WebViewClient() {
|
||||
override fun shouldOverrideUrlLoading(view: WebView?, request: WebResourceRequest?): Boolean {
|
||||
Log.i("Apple payload one: ", request?.url.toString() ?: "null")
|
||||
|
||||
@ -128,16 +128,14 @@ fun AuthProviderView(
|
||||
) {
|
||||
Spacer(modifier = Modifier.weight(1.0F))
|
||||
Column(
|
||||
// verticalArrangement = Arrangement.Center,
|
||||
// horizontalAlignment = Alignment.CenterHorizontally
|
||||
verticalArrangement = Arrangement.spacedBy(8.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(8.dp),
|
||||
horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
if (isGoogleAuthAvailable) {
|
||||
GoogleAuthButton(viewModel)
|
||||
}
|
||||
|
||||
// AppleAuthButton(viewModel)
|
||||
AppleAuthButton(viewModel)
|
||||
|
||||
ClickableText(
|
||||
text = AnnotatedString("Continue with Email"),
|
||||
|
||||
Reference in New Issue
Block a user