Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up Discord OAuth2 #16

Merged
merged 53 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
8481f7a
add oauth2 redirect
EthanThatOneKid Dec 22, 2023
c8fea3c
wip
EthanThatOneKid Dec 22, 2023
59ead76
Merge branch 'fix/13' of https://github.com/acmcsufoss/form into fix/13
EthanThatOneKid Dec 23, 2023
7d37847
wip
EthanThatOneKid Dec 23, 2023
b1c735d
added components for availability, data, datetime, time
k8iekitkat Dec 29, 2023
6b62521
added sample data for the new question types
AlexthePear Dec 29, 2023
7e3333d
Fixed Datetime question input
AlexthePear Dec 29, 2023
f6a2f13
wip
AlexthePear Dec 29, 2023
7d8a89d
Ran formating and added availability question
AlexthePear Dec 29, 2023
4b7b093
Removed unnecessary AvailabilityQuestionValue from imports in form.sv…
AlexthePear Dec 29, 2023
ff24bfd
Fixed spelling error lol
AlexthePear Dec 29, 2023
15ae92a
Added the name attribute to question types changed sumbit button
AlexthePear Dec 30, 2023
eee110c
blindly-coded wip
EthanThatOneKid Jan 6, 2024
e8378af
wip
EthanThatOneKid Jan 7, 2024
f991ee9
wip
EthanThatOneKid Jan 7, 2024
17aafc0
wip
EthanThatOneKid Jan 8, 2024
7a92d45
add form and submission to `Store` interface
EthanThatOneKid Jan 8, 2024
cd13a88
wip
EthanThatOneKid Jan 8, 2024
9c06d74
wip
EthanThatOneKid Jan 9, 2024
4e207c0
Merge remote-tracking branch 'origin/new-form-questions' into fix/13
EthanThatOneKid Jan 9, 2024
74b2586
wip
EthanThatOneKid Jan 9, 2024
96e6a9b
wip
EthanThatOneKid Jan 9, 2024
3f6fcc2
wip
EthanThatOneKid Jan 9, 2024
f3fcab3
wip
EthanThatOneKid Jan 10, 2024
e728735
wip
EthanThatOneKid Jan 10, 2024
1483e6b
wip
EthanThatOneKid Jan 31, 2024
edaf11d
Update kv.ts
EthanThatOneKid Jan 31, 2024
d429bfa
wip
EthanThatOneKid Feb 1, 2024
ef13708
update tentative landing page
EthanThatOneKid Feb 2, 2024
5122bd4
wip getting sessions to seemingly work maybe
EthanThatOneKid Feb 2, 2024
99824a9
Delete +server.ts
EthanThatOneKid Feb 2, 2024
8382195
run `npm run lint`
EthanThatOneKid Feb 3, 2024
f8b7767
add form preview components
EthanThatOneKid Feb 3, 2024
95ef2ea
wip
EthanThatOneKid Feb 8, 2024
b8c690d
wip
EthanThatOneKid Feb 9, 2024
c027f39
Squashed commit of the following:
EthanThatOneKid Feb 9, 2024
fc4c35a
wip
EthanThatOneKid Feb 9, 2024
0fc43ac
Merge branch 'main' into fix/13
EthanThatOneKid Feb 9, 2024
686f8f7
fixed demo_form css
AlexthePear Feb 10, 2024
303e353
fix demo form
EthanThatOneKid Feb 10, 2024
365a656
Update +page.svelte
EthanThatOneKid Feb 11, 2024
09f86c7
add form editor notes
EthanThatOneKid Feb 11, 2024
f334f3d
add check to createForm
EthanThatOneKid Feb 11, 2024
cddefe0
add redirect to `/discord_oauth2/logout` endpoint
EthanThatOneKid Feb 11, 2024
ec4246c
add `DENO_KV_CONNECT_URL` env var
EthanThatOneKid Feb 11, 2024
5bbc8e0
check workflow: copy default env vars
EthanThatOneKid Feb 11, 2024
bf7606d
check workflow: copy default env vars
EthanThatOneKid Feb 11, 2024
f34bdec
Merge branch 'fix/13' of https://github.com/acmcsufoss/form into fix/13
EthanThatOneKid Feb 11, 2024
a394dc2
move db files to `.denokv` directory
EthanThatOneKid Feb 11, 2024
a642d9a
Update check.yaml
EthanThatOneKid Feb 11, 2024
d260f35
check workflow: omit build step
EthanThatOneKid Feb 11, 2024
0e7b7d1
replace default `kvPath`
EthanThatOneKid Feb 22, 2024
11b9616
edit form editor component
EthanThatOneKid Feb 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
DENO_KV_ACCESS_TOKEN=""
DENO_KV_CONNECT_URL=""
DISCORD_REDIRECT_URI=""
DISCORD_CLIENT_ID=""
DISCORD_CLIENT_SECRET=""
DISCORD_GUILD_ID=""
DISCORD_ROLE_ID=""
DISCORD_BOT_TOKEN=""
9 changes: 6 additions & 3 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ jobs:
- name: Install Dependencies
run: npm ci

- name: Set up .env
run: cp .env.example .env

- name: Set up .env
run: cp .env.example .env

- name: Svelte check
run: npm run check

Expand All @@ -44,6 +50,3 @@ jobs:

- name: Lint
run: npm run lint && git diff --exit-code

- name: Build
run: npm run build
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ node_modules
!.env.example
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
.denokv*
183 changes: 183 additions & 0 deletions package-lock.json

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

8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,11 @@
"typescript": "^5.0.0",
"vite": "^4.4.2"
},
"type": "module"
"type": "module",
"dependencies": {
"@deno/kv": "^0.7.0",
"discord-api-types": "^0.37.67",
"export-to-csv": "^1.2.2",
"ulid": "^2.3.0"
}
}
7 changes: 6 additions & 1 deletion src/app.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import type { User } from '$lib/store';

// See https://kit.svelte.dev/docs/types#app
// for information about these interfaces
declare global {
namespace App {
// interface Error {}
// interface Locals {}
// interface PageData {}
// interface Platform {}

interface Locals {
user: User | undefined;
}
}
}

Expand Down
1 change: 1 addition & 0 deletions src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="%sveltekit.assets%/global.css" />
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
Expand Down
15 changes: 15 additions & 0 deletions src/hooks.server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { Handle } from '@sveltejs/kit';
import { s } from '$lib/resources/store';
import { SESSION_ID_COOKIE_NAME } from '$lib/oauth2';

export const handle: Handle = async ({ event, resolve }) => {
const sessionID = event.cookies.get(SESSION_ID_COOKIE_NAME);
if (sessionID) {
const user = await s.getUserBySessionID(sessionID);
if (user) {
event.locals.user = user;
}
}

return await resolve(event);
};
Loading
Loading