-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix user issues + start settings page
Co-Authored-By: Bloxs <[email protected]>
- Loading branch information
1 parent
4e0a93a
commit 3e12d43
Showing
37 changed files
with
152 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
# Events | ||
|
||
Events is a simple and easy to use event ticketing system. View the production website on https://events.deno.dev/! | ||
Events is a simple and easy to use event ticketing system. View the production | ||
website on https://events.deno.dev/! | ||
|
||
## Contributing | ||
|
||
Contribution guide coming soon! | ||
|
||
## Hosting | ||
|
||
Events is built with [Deno Deploy](https://deno.com/deploy) support in mind but you should be able to selfhost this anywhere, just copy `.env.example` to `.env` and update the variables. | ||
If you're selfhosting then KV requires an extra step with either creating a `db` folder for the database to be stored in or setting `DENO_DEPLOYMENT_ID` to anything for it to use the global version. | ||
Events is built with [Deno Deploy](https://deno.com/deploy) support in mind but | ||
you should be able to selfhost this anywhere, just copy `.env.example` to `.env` | ||
and update the variables. If you're selfhosting then KV requires an extra step | ||
with either creating a `db` folder for the database to be stored in or setting | ||
`DENO_DEPLOYMENT_ID` to anything for it to use the global version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
// basic switch if we ever need to use it | ||
export const Switch = ({ | ||
enabled, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,13 +2,16 @@ | |
"lock": false, | ||
"tasks": { | ||
"check": "deno fmt --check && deno lint && deno check **/*.ts && deno check **/*.tsx", | ||
"fmt": "npx prettier . --write", | ||
// Do items like reordering imports | ||
"fmt": "deno fmt && npx prettier . --write", | ||
"start": "deno run -A --unstable --watch=static/,routes/ dev.ts", | ||
"build": "deno run -A --unstable dev.ts build", | ||
"preview": "deno run --unstable -A main.ts", | ||
"update": "deno run --unstable -A -r https://fresh.deno.dev/update ." | ||
}, | ||
"lint": { "rules": { "tags": ["fresh", "recommended"] } }, | ||
"lint": { | ||
"rules": { "tags": ["fresh", "recommended"], "include": ["no-unused-vars"] } | ||
}, | ||
"imports": { | ||
"$fresh/": "https://deno.land/x/[email protected]/", | ||
"preact": "https://esm.sh/[email protected]", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { Handlers } from "$fresh/server.ts"; | ||
import { deleteCookie } from "$std/http/cookie.ts"; | ||
import { generateAuthToken, getUser, getUserAuthToken } from "@/utils/db/kv.ts"; | ||
|
||
export const handler: Handlers = { | ||
async GET(req, _ctx) { | ||
const token = getUserAuthToken(req); | ||
|
||
if (token == undefined) { | ||
return new Response(JSON.stringify({ error: "Not logged in" }), { | ||
status: 400, | ||
}); | ||
} | ||
|
||
const user = await getUser(req); | ||
|
||
if (user == undefined) { | ||
deleteCookie(req.headers, "authToken"); | ||
return new Response(JSON.stringify({ error: "User not found" }), { | ||
status: 400, | ||
}); | ||
} | ||
|
||
await generateAuthToken(user.email, true); | ||
|
||
deleteCookie(req.headers, "authToken"); | ||
|
||
return new Response(JSON.stringify({ status: 200 }), { | ||
status: 200, | ||
}); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.