Custom code ui

When using the require_discord project option LuaAuth links users discords using codes which are entered through a ui in game
LuaAuth provides a default ui, but sometimes that ui can look out of place so you might want to replace it with a custom one
We provide a macro to replace the ui with a custom one

Syntax: la_code_ui(func: const function)

We will provide your function with 1 argument, it is a function that can be used to verify the token the user provided
Calling this function will resume the main script and does not return anything

Example:

la_code_ui(function(checkCode)
    local ui = loadstring(...)()
    
	ui.onComplete:Connect(function(code)
        if code == '' then return end
        local success, reason = checkCode(code) -- the main script will resume loading if code is valid
        
        if success then
			con:Disconnect()
			ui:deleteMenu()
        else ui:showError(reason) end
    end)
end)