Skip to content

Commit

Permalink
If key missing to connect to server, do not have 4d error
Browse files Browse the repository at this point in the history
  • Loading branch information
e-marchand committed Sep 5, 2024
1 parent dc1cfc4 commit fcd94b5
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions Project/Sources/Methods/project_BUILD.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ If (Asserted:C1132($project#Null:C1517))
"build"; $data)

//$messageCancel:=New object(\
"action"; "build_ignoreServer"; \
"build"; $data)
"action"; "build_ignoreServer"; \
"build"; $data)

// Web server must running to test data synchronization
$message:=New object:C1471(\
Expand All @@ -272,14 +272,25 @@ If (Asserted:C1132($project#Null:C1517))

Else

var $keyFile : 4D:C1709.File
$keyFile:=cs:C1710.path.new().key()

var $keyText : Text
If ($keyFile.exists)
$keyText:=$keyFile.getText()
Else
$keyText:=""
End if
// TODO: do not try with no key, it will failed

// Check server-database structure
$rest:=Rest(New object:C1471(\
"action"; "tables"; \
"handler"; "mobileapp"; \
"url"; String:C10($project.server.urls.production); \
"headers"; New object:C1471(\
"X-MobileApp"; "1"; \
"Authorization"; "Bearer "+cs:C1710.path.new().key().getText())))
"Authorization"; "Bearer "+$keyText)))

$success:=$rest.success

Expand Down

0 comments on commit fcd94b5

Please sign in to comment.