New formatting
This commit is contained in:
@ -14,7 +14,7 @@ export async function onRequestGet(context: RequestContext) {
|
||||
`https://discord.com/oauth2/authorize?client_id=${
|
||||
env.DISCORD_ID
|
||||
}&redirect_uri=${encodeURIComponent(
|
||||
`${protocol}//${host}/api/auth/session`
|
||||
)}&response_type=code&scope=identify%20email%20guilds.members.read&state=${state}`
|
||||
`${protocol}//${host}/api/auth/session`,
|
||||
)}&response_type=code&scope=identify%20email%20guilds.members.read&state=${state}`,
|
||||
);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import tokenPrefixes from "../../../data/token_prefixes.json";
|
||||
async function generateTokenHash(token: string): Promise<string> {
|
||||
const hash = await crypto.subtle.digest(
|
||||
"SHA-512",
|
||||
new TextEncoder().encode(token)
|
||||
new TextEncoder().encode(token),
|
||||
);
|
||||
return btoa(String.fromCharCode(...new Uint8Array(hash)))
|
||||
.replace(/\+/g, "-")
|
||||
@ -62,7 +62,7 @@ export async function onRequestGet(context: RequestContext) {
|
||||
}).toString(),
|
||||
headers: {
|
||||
authorization: `Basic ${btoa(
|
||||
context.env.DISCORD_ID + ":" + context.env.DISCORD_SECRET
|
||||
context.env.DISCORD_ID + ":" + context.env.DISCORD_SECRET,
|
||||
)}`,
|
||||
"content-type": "application/x-www-form-urlencoded",
|
||||
},
|
||||
@ -114,7 +114,7 @@ export async function onRequestGet(context: RequestContext) {
|
||||
headers: {
|
||||
authorization: `Bearer ${tokenData.access_token}`,
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
const memberData: { [k: string]: any } = await serverMemberReq.json();
|
||||
@ -133,7 +133,7 @@ export async function onRequestGet(context: RequestContext) {
|
||||
selectedTokenStart +
|
||||
`${crypto.randomUUID()}${crypto.randomUUID()}${crypto.randomUUID()}${crypto.randomUUID()}`.replaceAll(
|
||||
"-",
|
||||
""
|
||||
"",
|
||||
);
|
||||
|
||||
const tokenHash = await generateTokenHash(authToken);
|
||||
|
Reference in New Issue
Block a user