Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/php_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

strategy:
matrix:
php: [7.4, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5]
php: [8.2, 8.3, 8.4, 8.5]

steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ What's included:
* `tests` - Test cases

## Getting started
This library requires PHP 7.4 or later
This library requires PHP 8.2 or later

To use SDK in your existing developing environment, install it from Packagist
```
Expand Down
2 changes: 1 addition & 1 deletion example/composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"require": {
"slim/slim": "4.12.0",
"slim/psr7": "1.6.1",
"slim/psr7": "^1.7",
"slim/php-view": "3.2.0",
"bryanjhv/slim-session": "4.1.2",
"duosecurity/duo_universal_php": "@dev"
Expand Down
9 changes: 9 additions & 0 deletions example/index.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

ob_start();

use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Logger;
Expand Down Expand Up @@ -34,6 +36,13 @@
$app->add(new Session());

$app->get('/', function (Request $request, Response $response, $args) {
# Helpfully redirect to `localhost` if accessed via 127.0.0.1 or 0.0.0.0 to ensure session cookie consistency and avoid state errors.
# (The url used in redirect_uri must match the url used to access the app)
if (in_array($request->getUri()->getHost(), ['127.0.0.1', '0.0.0.0'])) {
header('Location: http://localhost:' . $request->getUri()->getPort());
exit();
}

$renderer = new PhpRenderer('./templates');
$args["message"] = "This is a demo";
return $renderer->render($response, "login.php", $args);
Expand Down