hmn/src/rawdata/scss
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: #106
2023-05-06 19:38:50 +00:00
..
tachyons Bump default mobile breakpoint, make login link cursor a pointer 2023-01-16 22:11:50 -05:00
themes Update auth flows 2022-08-13 14:15:00 -05:00
_admin.scss Add SCSS build 2021-03-10 22:19:37 -06:00
_authors.scss Add SCSS build 2021-03-10 22:19:37 -06:00
_carousel.scss Add last year's projects to the jam page 2022-08-02 14:56:47 -05:00
_content.scss Make articles responsive 2022-10-26 13:26:01 -05:00
_core.scss Fix CSS issue on jams page 2023-04-22 11:31:14 -05:00
_editor.scss Add tag management to projects 2021-12-07 21:37:52 -06:00
_education.scss Add highlight to currently-selected education course 2022-10-31 17:39:19 -05:00
_episodes.scss Add SCSS build 2021-03-10 22:19:37 -06:00
_forms.scss Update auth flows 2022-08-13 14:15:00 -05:00
_forum.scss New buttons with project colors + small bugfix (#80) 2022-08-13 02:13:13 +00:00
_globals.scss Improve appearance of option bars on mobile 2021-09-08 23:01:21 -05:00
_header.scss Add Discord login (#106) 2023-05-06 19:38:50 +00:00
_icons.scss Profile page and timeline items 2021-06-22 12:50:40 +03:00
_irc.scss Add SCSS build 2021-03-10 22:19:37 -06:00
_landing.scss Rework the home page 2021-10-27 21:55:40 -05:00
_library.scss Add SCSS build 2021-03-10 22:19:37 -06:00
_notices.scss Replaced relogin rejection with a notice and proper redirect. 2021-09-05 22:50:15 +03:00
_profile.scss Add SCSS build 2021-03-10 22:19:37 -06:00
_progress_bar.scss Added file dialog, image pasting, and progress UI 2021-09-22 13:59:03 +03:00
_projects.scss Add last year's projects to the jam page 2022-08-02 14:56:47 -05:00
_showcase.scss Start migrating templates 2021-03-14 15:49:58 -05:00
_streams.scss Add SCSS build 2021-03-10 22:19:37 -06:00
_timeline.scss Fixed showcase modal again 2023-01-03 00:20:43 +02:00
style.scss Initial version of education content (#90) 2022-09-10 16:29:57 +00:00
theme.scss Add SCSS build 2021-03-10 22:19:37 -06:00