Commit Graph

579 Commits

Author SHA1 Message Date
Asaf Gartner 65aab39432 Asset thumbnail backend 2023-05-17 22:34:55 +03:00
Ben Visness 8dc458da73 Cover all URL builders with tests 2023-05-06 15:41:51 -05:00
bvisness 0210a0784b Add Discord login (#106)
This leverages our existing Discord OAuth implementation. Any users with a linked Discord account will be able to log in immediately. When logging in, we request the `email` scope in addition to `identity`, so existing users will be prompted one time to accept the new permissions. On subsequent logins, Discord will skip the prompt.

When linking your Discord account to an existing HMN account, we continue to only request the `identity` scope, so we do not receive the user's Discord email.

Both login and linking go through the same Discord OAuth callback. All flows through the callback try to achieve the same end goal: a logged-in HMN user with a linked Discord account.

Linking works the same as it ever has. Login, however, is different because we do not have a session ID to use as the OAuth state. To account for this, I have added a `pending_login` table that stores a secure unique ID and the eventual destination URL. These pending logins expire after 10 minutes. When we receive the OAuth callback, we look up the pending login by the OAuth `state` and immediately delete it. The destination URL will be used to redirect the user to the right place.

If we have a `discord_user` entry for the OAuth'd Discord user, we immediately log the user into the associated HMN account. This is the typical login case. If we do not have a `discord_user`, but there is exactly one HMN user with the same email address as the Discord user, we will link the two accounts and log into the HMN account.

(It is possible for multiple HMN accounts to have the same email, because we don't have a uniqueness constraint there. We fail the login in this case rather than link to the wrong account.)

Finally, if no associated HMN user exists, a new one will be created. It will use the Discord user's username, email, and avatar. This user will have no password, but they can set or reset a password through the usual flows.

Co-authored-by: Ben Visness <bvisness@gmail.com>
Reviewed-on: hmn/hmn#106
2023-05-06 19:38:50 +00:00
Ben Visness 1b1c25da80 Fix CSS issue on jams page 2023-04-22 11:31:14 -05:00
Ben Visness e4dd15d248 Add all jams index 2023-04-22 11:26:07 -05:00
Ben Visness faac05a3a8 Put recap section on the main page 2023-04-22 09:18:34 -05:00
Ben Visness 79c4c14631 Add jam recap (not yet shown off properly) 2023-04-21 23:11:32 -05:00
Ben Visness fe1d99b7ab Style project descriptions better 2023-04-16 16:05:04 -05:00
Ben Visness 23e67638e4 Merge remote-tracking branch 'origin/beta' 2023-04-14 15:47:32 -05:00
Ben Visness 89dd2c52c7 Link back to the main jam page from the feed 2023-04-14 15:46:06 -05:00
Ben Visness b7d4883c6c Make news posts look a little nicer 2023-04-13 17:53:36 -05:00
Ben Visness 60a9ece643 News posts are BACK 2023-04-13 17:41:10 -05:00
Ben Visness 25f33451ca New manifesto?? 2023-04-12 19:10:29 -05:00
Asaf Gartner ef16a4f3e0 Fixed style and links for vis jam 2023-04-11 17:38:32 +03:00
Ben Visness 4651e8a477 &nbsp; 2023-04-08 13:09:28 -05:00
Ben Visness 44e055155e Redo the home page banner copy 2023-04-08 13:07:40 -05:00
Ben Visness 2cb367ba18 Update README to warn about wellington problems 2023-04-08 11:49:48 -05:00
Ben Visness fc6b979a46 Update implementation of utils.DirFS
It is now patterned after the Go 1.20 implementation, in order to better represent the current state of things in a proposal I am making.
2023-04-08 11:41:02 -05:00
Ben Visness 524cf8e27b Add ability to load templates live from the filesystem
See config.go.example.
2023-04-08 11:14:44 -05:00
Asaf Gartner 3a66b7a77d Restored jam dates 2023-04-07 01:13:41 +03:00
Asaf Gartner 4994cb7701 Testing postjam 2023-04-07 01:08:47 +03:00
Asaf Gartner c50d8f8ea4 Testing with different dates 2023-04-07 01:04:24 +03:00
Jake Mason 45b5c7f4d4 Updating Feed for VJ 2023 2023-04-06 14:54:14 -04:00
Jake Mason f9f0e1b119 Add VJ2023 to the AllJams list 2023-04-06 14:39:45 -04:00
Jake Mason 54c9af9c08 Hide counters until 30 days out 2023-03-24 21:22:17 -04:00
Jake Mason e616cc51fd One more mobile fix 2023-03-24 17:58:46 -04:00
Jake Mason c6cdc8a473 Some more mobile updates to the handmade cities banner 2023-03-24 17:52:42 -04:00
Jake Mason 20c4a277ff Update link for tickets, style adjustments 2023-03-24 17:46:40 -04:00
Jake Mason 0ccf3aba1a Add handmade cities banner v1 2023-03-24 17:38:24 -04:00
Ben Visness cf345ca592 Add a little more inspiration 2023-03-07 14:02:11 -06:00
Ben Visness 81b92d3aef Add special Twitter card 2023-03-07 12:09:22 -06:00
Ben Visness 5296e0a15a Fix jam opengraph 2023-03-07 11:57:44 -06:00
Ben Visness 55f56d8ae0 Vis jam landing page 2023-03-07 11:48:13 -06:00
Ben Visness bb38d0b759 Merge remote-tracking branch 'origin/feature/2023_frontend_updates' 2023-03-07 11:40:26 -06:00
Jake Mason 7a6cdbad0e Adding days of the week back - was looking at wrong year, doh! 2023-03-05 20:46:17 -05:00
Jake Mason 395ca8e765 Discord link added 2023-03-05 20:43:53 -05:00
Jake Mason 4bb562823e Opengraph images, and fix day-of-week references 2023-03-05 20:40:22 -05:00
Jake Mason 526a588a19 Visualization Jam 2023 template 2023-03-04 23:52:03 -05:00
Ben Visness 6d24738be6 Comment out the Handmade Seattle banner 2023-02-22 00:42:08 -06:00
Asaf Gartner a324af8a0c Updated example config 2023-01-29 08:53:57 +02:00
Asaf Gartner 859a78c079 Fixed excessive db conns in middleware and pgx race condition on init 2023-01-29 08:53:57 +02:00
Asaf Gartner aa6428f3a4 Removed remaining pgxv4 stuff and fixed twitch tags 2023-01-29 08:53:57 +02:00
Asaf Gartner 2af28d9f3f Update pgx v4 to pgx v5 2023-01-29 08:53:57 +02:00
Ben Visness 9e27835e51 Add /manifesto Discord command 2023-01-22 09:38:14 -06:00
Jake Mason 1825e93b04 Compile .scss assets 2023-01-16 23:02:54 -05:00
Jake Mason df253d0a33 Some more basic dropdown a11y considerations 2023-01-16 23:02:36 -05:00
Jake Mason ad904de16b Removing hrefs like this is breaks a11y entirely 2023-01-16 22:24:44 -05:00
Jake Mason 922d6283f8 Jump to content link for a11y 2023-01-16 22:22:23 -05:00
Jake Mason b2f8bb45cf Ignore session and tags files 2023-01-16 22:12:12 -05:00
Jake Mason 299bf5e065 Bump default mobile breakpoint, make login link cursor a pointer 2023-01-16 22:11:50 -05:00