<script type="text/javascript" src="https://auth.varo.domains/v1"></script>
var varo = new Varo();
varo.auth().then(auth => {
if (auth.success) {
// handle success by calling your api to update the users session
$.post("/auth", JSON.stringify(auth.data), (response) => {
window.location.reload();
});
}
});
{
"data": {
"request": "00000000000000000000000000000000",
"id": "11111111111111111111111111111111",
"name": "varo"
},
"success": true
}
<?php
session_start();
// ^ make sure to add this line to all pages of your site
$json = file_get_contents("php://input");
$data = json_decode($json, true);
$verify = file_get_contents("https://auth.varo.domains/verify/".$data["request"]);
$decoded = @json_decode($verify, true)["data"];
if (@$decoded["name"]) {
$_SESSION["name"] = $decoded["name"];
}
?>