When you log in with Google, a browser window opens to confirm the user. This is not practical for me.
When logging in with email and password, would the application open directly?
Would it be abusing if I asked for an example of how to do it?
If I try, it gives me an error. ( Being
[email protected]","XXXXXXXX" the username and password I use to sing in on Supabase)
B4X:
#IF B4J
Private Sub xlbl_SignInWithGoogle_MouseClicked (EventData As MouseEvent)
#Else
Private Sub xlbl_SignInWithGoogle_Click
#End If
#If B4A
Wait For (xSupabase.Auth.SignInWithOAuth("xxx.apps.googleusercontent.com","google","profile email https://www.googleapis.com/auth/userinfo.email")) Complete (User As SupabaseUser)
#Else If B4I
Wait For (xSupabase.Auth.SignInWithOAuth("xxx.apps.googleusercontent.com","google","profile email https://www.googleapis.com/auth/userinfo.email")) Complete (User As SupabaseUser)
#Else If B4J
Wait For (xSupabase.Auth.LogIn_EmailPassword("[email protected]","XXXXXXXX")) Complete (User As SupabaseUser)
#End If
If User.Error.Success Then
Log("successfully logged in with " & User.Email)
xui.MsgboxAsync("successfully logged in with " & User.Email, "SignIn with Google")
Else
Log("Error: " & User.Error.ErrorMessage)
xui.MsgboxAsync("Error: " & User.Error.ErrorMessage, "SignIn with Google")
End If
End Sub
[CODE lang="b4x" title="Error"]WARNING: package com.sun.javafx.embed.swing.oldimpl not in javafx.swing
Waiting for debugger to connect...
Program started.
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
ResponseError. Reason: , Response: {"error":"invalid_grant","error_description":"Invalid login credentials"}
Error occurred on line: 309 (Supabase_Authentication)
java.lang.NumberFormatException: For input string: "null"
at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054)
at java.base/jdk.internal.math.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
at java.base/java.lang.Double.parseDouble(Double.java:735)
at anywheresoftware.b4a.BA.ObjectToNumber(BA.java:434)
at b4j.example.supabase_authentication$ResumableSub_Login_EmailPassword.resume(supabase_authentication.java:187)
at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resumeAsUserSub(DebugResumableSub.java:47)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:578)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:629)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:237)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:578)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resume(DebugResumableSub.java:42)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:156)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:105)
[/CODE]