Macros
info
LuaAuth provides some macros, which are custom functions you can use
la_secure_request
danger
this does NOT stop the user from viewing your request data
syntax: la_secure_request(data: table): table
this function is used exactly like request, except it detects users tampering with / modifying a request
return data:
- Success
- Error
{
success: true,
response: {} -- request data
}
{
success: false,
reason: 'request failed' OR 'tampering detected',
error_message: 'error message if request failed'
}
Example code
local data = la_secure_request({
Url = 'https://example.com',
Method = 'GET'
})
if not data.success then
print('request failed, reason: ' .. data.reason)
return
end
print('request body: ' .. data.response.Body)
la_secure_kick
syntax: la_secure_kick(message: string)
this function is used to garantee the local player is kicked
the users game will be crashed if they prevent the kick
Example code
if not data.success then
la_secure_kick('tampering detected')
return
end