Two bugs found and will be fixed in next version.
In User Login Server,
UsersApiHandler
Update to the following code:
[CODE lang="b4x" highlight="3"]Private Sub ValidateToken (Token As UserData) As Boolean
Try
If Token = Null Or Token.IsInitialized = False Then
HRM.ResponseCode = 401
HRM.ResponseError = "Undefine User Token"
ReturnApiResponse
Return False
End If[/CODE]
In User Login Client app,
B4XPageUserProfile
Update to the following code:
[CODE lang="b4x" highlight="12"]Sub UpdateProfile
Try
Log("[B4XPageUserProfile] UpdateProfile")
Dim data As Map
data.Initialize
data.Put("key", Main.User.ApiKey)
data.Put("token", Main.User.Token)
data.Put("user_name", txtUserName.Text.Trim)
data.Put("user_location", txtUserLocation.Text.Trim)
Dim job As HttpJob
job.Initialize("", Me)
job.PutString(Main.strURL & "users/update-profile", data.As(JSON).ToString)
job.GetRequest.SetHeader("Authorization", "Bearer " & Main.User.Token)
Wait For (job) JobDone(job As HttpJob)[/CODE]