Skip to content

Commit 44a89f5

Browse files
committed
wait a min
1 parent 67d2bd7 commit 44a89f5

File tree

7 files changed

+38
-34
lines changed

7 files changed

+38
-34
lines changed

index.html

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,10 @@
1-
<!doctype html>
1+
<!DOCTYPE html>
22
<html lang="en">
3-
43
<head>
5-
<title>Login</title>
6-
<meta charset="UTF-8">
7-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
8-
<base href="/">
9-
<link rel="stylesheet" href="./public/output.css">
10-
<link rel="stylesheet" href="./public/stylesheets/indexStyle.css">
11-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css"
12-
integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g=="
13-
crossorigin="anonymous" referrerpolicy="no-referrer" />
4+
<meta http-equiv="refresh" content="0; url=public/html/index.html">
5+
<title>Redirecting...</title>
146
</head>
15-
167
<body>
17-
<div class="flex items-center justify-center h-screen bg-discord-gray text-white">
18-
<a id="login"
19-
href="https://discord.com/oauth2/authorize?client_id=1218308582844534794&response_type=token&redirect_uri=http%3A%2F%2Flocalhost%3A53134%2Fauth%2Fdiscord&scope=identify"
20-
class="bg-discord-blue text-xl px-5 py-3 rounded-md font-bold flex items-center space-x-4 hover:bg-gray-600 transition duration-75">
21-
22-
<h1>
23-
Login with
24-
<span>Discord</span>
25-
</h1>
26-
</a>
27-
</div>
8+
<p>If you are not redirected automatically, follow this <a href="./public/html/index.html">link</a>.</p>
289
</body>
29-
3010
</html>

public/html/index.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<head>
2+
<title>Login</title>
3+
<meta charset="UTF-8">
4+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
5+
<base href="/">
6+
<link rel="stylesheet" href="../stylesheets/output.css">
7+
<link rel="stylesheet" href="./stylesheets/indexStyle.css">
8+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css"
9+
integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g=="
10+
crossorigin="anonymous" referrerpolicy="no-referrer" />
11+
</head>
12+
13+
<body>
14+
<div class="flex items-center justify-center h-screen bg-discord-gray text-white">
15+
<a id="login"
16+
href="https://discord.com/oauth2/authorize?client_id=1218308582844534794&response_type=token&redirect_uri=http%3A%2F%2Flocalhost%3A53134%2Fauth%2Fdiscord&scope=identify"
17+
class="bg-discord-blue text-xl px-5 py-3 rounded-md font-bold flex items-center space-x-4 hover:bg-gray-600 transition duration-75">
18+
19+
<h1>
20+
Login with
21+
<span>Discord</span>
22+
</h1>
23+
</a>
24+
</div>
25+
</body>

index.js renamed to public/index.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ const app = express();
77
app.use(express.static(path.join(__dirname, 'public')));
88

99
app.get('/', (request, response) => {
10-
return response.sendFile('index.html', { root: __dirname });
10+
return response.sendFile('html/index.html', { root: __dirname });
1111
});
1212

1313
app.get('/auth/discord', (request, response) => {
14-
return response.sendFile('dashboard.html', { root: __dirname });
14+
return response.sendFile('html/dashboard.html', { root: __dirname });
1515
});
1616

1717
app.get('/CreateCard', function(request, response) {
18-
return response.sendFile('public/NavBarOptions/CreateCard/CreateCard.html', { root: __dirname });
18+
return response.sendFile('NavBarOptions/CreateCard/CreateCard.html', { root: __dirname });
1919
});
2020

2121
app.get('/Gallery', function(request, response) {
22-
return response.sendFile('public/NavBarOptions/Gallery/Gallery.html', { root: __dirname });
22+
return response.sendFile('NavBarOptions/Gallery/Gallery.html', { root: __dirname });
2323
});
2424

2525
app.get('*', (request, response) => {
@@ -28,7 +28,7 @@ app.get('*', (request, response) => {
2828
});
2929

3030
app.get('navbar-input', (request, response) => {
31-
return response.sendFile('navbar.html', { root: __dirname });
31+
return response.sendFile('html/navbar.html', { root: __dirname });
3232
});
3333

3434
app.use(session({
@@ -60,7 +60,7 @@ app.get('/auth/discord/callback', (req, res) => {
6060
return res.status(500).send('Internal Server Error');
6161
}
6262
req.session.accessToken = accessToken;
63-
res.redirect('/dashboard');
63+
res.redirect('../public/html/dashboard.html');
6464
});
6565
});
6666

@@ -69,5 +69,5 @@ app.use((req, res, next) => {
6969
next();
7070
});
7171

72-
const port = '53134';
73-
app.listen(port, () => console.log(`App listening at http://localhost:${port}`));
72+
const port = '5500';
73+
app.listen(port, () => console.log(`App listening at http://127.0.0.1:${port}`));

loadWindow.js renamed to public/loadWindow.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ window.onload = () => {
33
const [accessToken, tokenType] = [fragment.get('access_token'), fragment.get('token_type')];
44

55
if (!accessToken) {
6-
window.location.href = '/';
6+
window.location.href = '../public/html/index.html';
77
return;
88
}
99

10-
1110
fetch('https://discord.com/api/users/@me', {
1211
headers: {
1312
authorization: `${tokenType} ${accessToken}`,

0 commit comments

Comments
 (0)