changeset 15:d0b8e1a8fc69

minor
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 01 Nov 2023 00:12:08 -0600
parents 80105b716a62
children 552d6f944acb
files src/add_server.html.luan src/delete_server.js.luan src/login1.red.luan src/login2.html.luan
diffstat 4 files changed, 5 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/add_server.html.luan	Tue Oct 31 23:56:48 2023 -0600
+++ b/src/add_server.html.luan	Wed Nov 01 00:12:08 2023 -0600
@@ -49,7 +49,7 @@
 	local config = Config.get()
 	local options = {
 		headers = {
-			["User-Agent"] = "fuck you"  -- for retarded Cloudflare
+			["User-Agent"] = "Disearch"  -- for retarded Cloudflare
 			Authorization = "Bot "..config.discord.bot_token
 		}
 	}
--- a/src/delete_server.js.luan	Tue Oct 31 23:56:48 2023 -0600
+++ b/src/delete_server.js.luan	Wed Nov 01 00:12:08 2023 -0600
@@ -22,7 +22,7 @@
 	local options = {
 		method = "DELETE"
 		headers = {
-			["User-Agent"] = "fuck you"  -- for retarded Cloudflare
+			["User-Agent"] = "Disearch"  -- for retarded Cloudflare
 			Authorization = "Bot "..config.discord.bot_token
 		}
 	}
--- a/src/login1.red.luan	Tue Oct 31 23:56:48 2023 -0600
+++ b/src/login1.red.luan	Wed Nov 01 00:12:08 2023 -0600
@@ -13,8 +13,7 @@
 return function()
 	local config = Config.get()
 	local redirect_uri = discord_redirect_uri()
-	local scope = "identify guilds"
-	local url = "https://discord.com/api/oauth2/authorize?client_id="..config.discord.client_id.."&redirect_uri="..url_encode(redirect_uri).."&response_type=code&scope="..url_encode(scope)
+	local url = "https://discord.com/api/oauth2/authorize?client_id="..config.discord.client_id.."&redirect_uri="..url_encode(redirect_uri).."&response_type=code&scope=identify"
 	-- logger.info(url)
 	Http.response.send_redirect(url)
 end
--- a/src/login2.html.luan	Tue Oct 31 23:56:48 2023 -0600
+++ b/src/login2.html.luan	Wed Nov 01 00:12:08 2023 -0600
@@ -22,7 +22,7 @@
 	local options = {
 		method = "POST"
 		headers = {
-			["User-Agent"] = "fuck you"  -- for retarded Cloudflare
+			["User-Agent"] = "Disearch"  -- for retarded Cloudflare
 		}
 		authorization = {
 			username = config.discord.client_id
@@ -40,14 +40,12 @@
 	-- logger.info(result)
 	result = json_parse(result)
 	local access_token = result.access_token or error()
-	local refresh_token = result.refresh_token or error()
 	logger.info("access_token = "..access_token)
-	Http.response.set_persistent_cookie("refresh_token",refresh_token)
 
 	local url = "https://discord.com/api/users/@me"
 	local options = {
 		headers = {
-			["User-Agent"] = "fuck you"  -- for retarded Cloudflare
+			["User-Agent"] = "Disearch"  -- for retarded Cloudflare
 			Authorization = "Bearer "..access_token
 		}
 	}