samedi 26 décembre 2015

Protecting pages - Laravel

In old fashioned php, if I wanted to prevent access to a page for some reason (not necessarily authentication) I would use the code below;

if (!isset($_GET["token"])) {
    header("Location: password-link-invalid.html");
    exit;
}

if (!isset($_GET["timestamp"])) {
    header("Location: password-link-invalid.html");
    exit;
}

if ($_SERVER["REQUEST_TIME"] - $timestamp > 3600)
{
    header("Location: password-link-expired.html");
    exit;
}

How would I achieve this in Laravel?

Thanks



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire