Sub btnUpdate_Clicked(Target As String)
Private url As String = ws.EvalWithResult("return location.href",Null).Value
If url.ToLowerCase.Contains("#") Then
Dim hash As String
hash = url.SubString(url.IndexOf("#") + 1)
Dim result1 As Map
result1.Initialize
Dim params() As String
params = Regex.Split("&", hash)
For Each param As String In params
Dim parts() As String
parts = Regex.Split("=", param)
If parts.Length = 2 Then
result1.Put(parts(0), parts(1))
End If
Next
' Now 'result' contains the key-value pairs from the hash
Log(result1)
'Put all the extracted parameters from URL to Supabase's token iformation in order to allow us to update the new password
xSupabase.Auth.TokenInformations.AccessToken=result1.Get("access_token")
xSupabase.Auth.TokenInformations.RefreshToken=result1.Get("refresh_token")
xSupabase.Auth.TokenInformations.AccessExpiry=result1.Get("expires_at")
xSupabase.Auth.TokenInformations.TokenType=result1.Get("token_type")
xSupabase.Auth.TokenInformations.Valid=True
'Repeat Password edit text. We will use it order to get the new password
Dim etPassRepeat As ABMInput = page.Component("etPass")
Wait For (xSupabase.Auth.UpdateUser("[email protected]",etPassRepeat.Text)) Complete (result As SupabaseError)
If result.Success Then
Log("User data successfully changed")
Else
Log("Error: " & result.ErrorMessage)
End If
End If
End Sub