-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
66 lines (51 loc) · 2.39 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
// Require composer autoloader
require __DIR__ . '/vendor/autoload.php';
require __DIR__ . '/dotenv-loader.php';
$auth0 = new \Auth0\SDK\Auth0(array(
'domain' => getenv('AUTH0_DOMAIN'),
'client_id' => getenv('AUTH0_CLIENT_ID'),
'client_secret' => getenv('AUTH0_CLIENT_SECRET'),
'redirect_uri' => getenv('AUTH0_CALLBACK_URL')
));
$userInfo = $auth0->getUser();
?>
<html>
<head>
<script src="https://code.jquery.com/jquery-2.2.1.min.js" type="text/javascript"></script>
<script src="https://cdn.auth0.com/js/lock-9.0.min.js"></script>
<script type="text/javascript" src="//use.typekit.net/iws6ohy.js"></script>
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- font awesome from BootstrapCDN -->
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet">
<script>
var AUTH0_CLIENT_ID = '<?php echo getenv("AUTH0_CLIENT_ID") ?>';
var AUTH0_DOMAIN = '<?php echo getenv("AUTH0_DOMAIN") ?>';
var AUTH0_CALLBACK_URL = '<?php echo getenv("AUTH0_CALLBACK_URL") ?>';
</script>
<script src="public/app.js"> </script>
<link href="public/app.css" rel="stylesheet">
</head>
<body class="home">
<div class="container">
<div class="login-page clearfix">
<?php if(!$userInfo): ?>
<div class="login-box auth0-box before">
<img src="https://i.cloudup.com/StzWWrY34s.png" />
<h3>Auth0 Example</h3>
<p>Zero friction identity infrastructure, built for developers</p>
<a class="btn btn-primary btn-lg btn-login btn-block">SignIn</a>
</div>
<?php else: ?>
<div class="logged-in-box auth0-box logged-in">
<h1 id="logo"><img src="//cdn.auth0.com/samples/auth0_logo_final_blue_RGB.png" /></h1>
<img class="avatar" src="<?php echo $userInfo['picture'] ?>"/>
<h2>Welcome <span class="nickname"><?php echo $userInfo['nickname'] ?></span></h2>
</div>
<?php endif ?>
</div>
</div>
</body>
</html>