Skip to content

Commit

Permalink
Force login to provider
Browse files Browse the repository at this point in the history
  • Loading branch information
g105b committed Mar 14, 2020
0 parents commit 000bca1
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.idea/
/vendor/
16 changes: 16 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "authwave/app-admin",
"description": "Hosted application administration and configuration.",
"type": "project",

"require": {
"phpgt/webengine": "dev-master",
"authwave/php-client": "v0.2.0"
},

"autoload": {
"psr-4": {
"Authwave\\": "./class"
}
}
}
6 changes: 6 additions & 0 deletions config.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[app]
namespace=Authwave

[authwave]
id=authwave-app-admin
key=0123456789abcdef
15 changes: 15 additions & 0 deletions page/_common.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
namespace Authwave\Page;

use Authwave\Authenticator;
use Gt\WebEngine\Logic\Page;

class _CommonPage extends Page {
public Authenticator $auth;

public function go():void {
if(!$this->auth->isLoggedIn()) {
$this->auth->login();
}
}
}
21 changes: 21 additions & 0 deletions page/_setup.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php
namespace Authwave\Page;

use Authwave\Authenticator;
use Gt\WebEngine\Logic\PageSetup;

class _SetupPage extends PageSetup {
public function go():void {
$auth = new Authenticator(
$this->config->get("authwave.id"),
$this->config->get("authwave.key"),
$this->server->getRequestUri(),
"http://localhost:8082",
$this->session->getStore(
"authwave",
true
)
);
$this->logicProperty->set("auth", $auth);
}
}
4 changes: 4 additions & 0 deletions page/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<!doctype html>
<meta charset="utf-8" />
<title>Authwave admin</title>
<h1>Authwave admin</h1>

0 comments on commit 000bca1

Please sign in to comment.