diff --git a/examples/basic-webapp/composer.json b/examples/basic-webapp/composer.json index 0d8e8606..d784244d 100644 --- a/examples/basic-webapp/composer.json +++ b/examples/basic-webapp/composer.json @@ -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": [ diff --git a/examples/basic-webapp/index.php b/examples/basic-webapp/index.php index 58407e41..fa64e821 100644 --- a/examples/basic-webapp/index.php +++ b/examples/basic-webapp/index.php @@ -18,8 +18,8 @@ ?>
- - + + diff --git a/examples/basic-webapp/public/app.js b/examples/basic-webapp/public/app.js index 7f2fd6d8..816c29e5 100644 --- a/examples/basic-webapp/public/app.js +++ b/examples/basic-webapp/public/app.js @@ -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(); }); }); diff --git a/src/Auth0AuthApi.php b/src/Auth0AuthApi.php index 68af80a8..67c686fc 100644 --- a/src/Auth0AuthApi.php +++ b/src/Auth0AuthApi.php @@ -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 = []){ diff --git a/tests/AuthApiTest.php b/tests/AuthApiTest.php index 5e5dca52..f40d0416 100644 --- a/tests/AuthApiTest.php +++ b/tests/AuthApiTest.php @@ -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'])); } -} \ No newline at end of file +}