Skip to content

Commit

Permalink
v3.0.2: Fix logout.php, don't rely on the theme's sparkart-universe-b…
Browse files Browse the repository at this point in the history
…undle.js
  • Loading branch information
joanniclaborde committed Jun 5, 2024
1 parent c5c86b2 commit 87f8a09
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions build/universe.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ function prompt (fanclub, options, processor, popup) {
processor = options;
options = undefined;
}
if (popup === undefined) popup = true;

// Set the "popup=1" option, to force a redirect to /login/reload,
// which is the page responsible with storing the returned Universe tokens
Expand Down
5 changes: 3 additions & 2 deletions login/logout.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
<html lang="en">
<head>
<meta name="referrer" content="origin">
<script src="<?php echo get_template_directory_uri(); ?>/js/sparkart-universe-bundle.js"></script>
</head>
<body>

<a id="redirect" referrerpolicy="origin" style="display:none"></a>
<a id="redirect" referrerpolicy="origin" style="display:none" href="<?= Universe\logout_url() ?>"></a>
<script>

// Clear the auth tokens and redirect to Universe so it can clear its session
Expand All @@ -17,6 +16,8 @@
localStorage.removeItem('universeRefreshToken');
localStorage.removeItem('universeRefreshTokenExpiration');

document.getElementById('redirect').click();

</script>
</body>
</html>
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "universe-js",
"version": "3.0.1",
"version": "3.0.2",
"main": "index.js",
"author": {
"name": "Joannic Laborde",
Expand Down
2 changes: 1 addition & 1 deletion universe-js.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Universe JS
* Plugin URI: https://github.com/sparkartgroup/universe-js
* Description: Javascript modules and PHP functions for interacting with Sparkart's Universe API.
* Version: 3.0.1
* Version: 3.0.2
* Author: Sparkart Group, Inc.
* Author URI: http://www.sparkart.com/
*/
Expand Down

0 comments on commit 87f8a09

Please sign in to comment.