Skip to content

Commit

Permalink
Merge branch 'master' of github.com:auth0/auth0-PHP
Browse files Browse the repository at this point in the history
  • Loading branch information
glena committed Aug 4, 2016
2 parents 38ad623 + 72e34f9 commit 8ef2b94
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 18 deletions.
4 changes: 2 additions & 2 deletions examples/basic-webapp/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "auth0/basic-webapp-sample",
"description": "Basic sample for securing a WebApp with Auth0",
"require": {
"vlucas/phpdotenv": "2.2.0",
"auth0/auth0-php": "~3.0"
"vlucas/phpdotenv": "2.3.0",
"auth0/auth0-php": "~3.3"
},
"license": "MIT",
"authors": [
Expand Down
4 changes: 2 additions & 2 deletions examples/basic-webapp/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
?>
<html>
<head>
<script src="http://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 src="http://code.jquery.com/jquery-3.0.0.min.js" type="text/javascript"></script>
<script src="https://cdn.auth0.com/js/lock/10.0/lock.min.js"></script>

<script type="text/javascript" src="//use.typekit.net/iws6ohy.js"></script>
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
Expand Down
16 changes: 7 additions & 9 deletions examples/basic-webapp/public/app.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
$(document).ready(function() {

var lock = new Auth0Lock(AUTH0_CLIENT_ID, AUTH0_DOMAIN);

$('.btn-login').click(function(e) {
e.preventDefault();

lock.show({
callbackURL: AUTH0_CALLBACK_URL
var lock = new Auth0Lock(AUTH0_CLIENT_ID, AUTH0_DOMAIN, { auth: {
redirectUrl: AUTH0_CALLBACK_URL
, responseType: 'code'
, authParams: {
, params: {
scope: 'openid'
}
});
}});

$('.btn-login').click(function(e) {
e.preventDefault();
lock.show();
});
});
2 changes: 1 addition & 1 deletion src/Auth0AuthApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function get_logout_link($returnTo = null, $client_id = null) {

$query_string = Psr7\build_query($params);

return "https://{$this->domain}/logout?$query_string";
return "https://{$this->domain}/v2/logout?$query_string";
}

public function authorize_with_accesstoken($access_token, $connection, $scope = 'openid', $aditional_params = []){
Expand Down
8 changes: 4 additions & 4 deletions tests/AuthApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ public function testLogoutLink() {

$api = new Auth0AuthApi($env['DOMAIN'], $env['GLOBAL_CLIENT_ID'], $env['GLOBAL_CLIENT_SECRET']);

$this->assertSame("https://" . $env['DOMAIN'] . "/logout?", $api->get_logout_link());
$this->assertSame("https://" . $env['DOMAIN'] . "/v2/logout?", $api->get_logout_link());

$this->assertSame("https://" . $env['DOMAIN'] . "/logout?returnTo=http%3A%2F%2Fexample.com", $api->get_logout_link("http://example.com"));
$this->assertSame("https://" . $env['DOMAIN'] . "/v2/logout?returnTo=http%3A%2F%2Fexample.com", $api->get_logout_link("http://example.com"));

$this->assertSame("https://" . $env['DOMAIN'] . "/logout?returnTo=http%3A%2F%2Fexample.com&client_id=" . $env['GLOBAL_CLIENT_ID'], $api->get_logout_link("http://example.com", $env['GLOBAL_CLIENT_ID']));
$this->assertSame("https://" . $env['DOMAIN'] . "/v2/logout?returnTo=http%3A%2F%2Fexample.com&client_id=" . $env['GLOBAL_CLIENT_ID'], $api->get_logout_link("http://example.com", $env['GLOBAL_CLIENT_ID']));
}
}
}

0 comments on commit 8ef2b94

Please sign in to comment.