diff options
| author | Bobby <[email protected]> | 2024-10-13 09:06:13 -0400 |
|---|---|---|
| committer | Bobby <[email protected]> | 2024-10-13 09:06:13 -0400 |
| commit | b2a7486de2ea7f33b70ab88bc304b98e26c548ea (patch) | |
| tree | 6a894cf48f1d913f0bdda2448028803001373267 | |
| parent | 835fb19f8d6a1ba582294683bcad159dc9bcd23d (diff) | |
| download | yugen-b2a7486de2ea7f33b70ab88bc304b98e26c548ea.tar.xz yugen-b2a7486de2ea7f33b70ab88bc304b98e26c548ea.zip | |
removed discord activity
| -rw-r--r-- | authentication/utils.py | 4 | ||||
| -rw-r--r-- | templates/watch/watch.html | 24 |
2 files changed, 2 insertions, 26 deletions
diff --git a/authentication/utils.py b/authentication/utils.py index abef14f..3a18541 100644 --- a/authentication/utils.py +++ b/authentication/utils.py @@ -41,7 +41,7 @@ def get_redirect_uri(): # Only Authenticated Users who are in our Discord Server can access the website discord_client_id = os.environ.get("DISCORD_CLIENT_ID") discord_redirect_uri = os.environ.get("DISCORD_REDIRECT_URI") - discord_scope = "identify guilds guilds.members.read rpc" + discord_scope = "identify guilds guilds.members.read" redirect_uri = f"https://discord.com/oauth2/authorize?client_id={discord_client_id}&response_type=code&redirect_uri={discord_redirect_uri}&scope={discord_scope}" return redirect_uri @@ -111,7 +111,7 @@ def exchange_code(code): "grant_type": "authorization_code", "code": code, "redirect_uri": discord_redirect_uri, - "scope": "identify guilds guilds.members.read rpc", + "scope": "identify guilds guilds.members.read", } headers = {"Content-Type": "application/x-www-form-urlencoded"} diff --git a/templates/watch/watch.html b/templates/watch/watch.html index 93f2ff0..58765ae 100644 --- a/templates/watch/watch.html +++ b/templates/watch/watch.html @@ -1466,28 +1466,4 @@ fetch(nextEpisodeUrl.href); {% endif %} </script> -<script> - function clearDiscordStatus() { - const url = '{% url "watch:clear_discord_status" %}'; - const data = new FormData(); - data.append('csrfmiddlewaretoken', '{{ csrf_token }}'); - - if (navigator.sendBeacon) { - // Use sendBeacon for page unload or tab close - navigator.sendBeacon(url, data); - } else { - // Fallback for fetch if sendBeacon is not available - fetch(url, { - method: 'POST', - body: data, - }); - } - } - - // Trigger on page unload and navigation events - window.addEventListener('beforeunload', clearDiscordStatus); - window.addEventListener('popstate', clearDiscordStatus); - window.addEventListener('unload', clearDiscordStatus); - -</script> {% endblock scripts %} |
