Skip to content

Discord OAuth#141

Merged
jb3 merged 17 commits into
mainfrom
discord-oauth
Mar 7, 2021
Merged

Discord OAuth#141
jb3 merged 17 commits into
mainfrom
discord-oauth

Conversation

@HassanAbouelela
Copy link
Copy Markdown
Contributor

@HassanAbouelela HassanAbouelela commented Feb 12, 2021

Description

This PR implements Discord OAuth for this notion ticket.

python-discord/forms-backend#58 needs to be merged before this PR.

Moves all authorization functionality to a new file, and adds a helper
to send discord OAuth code to the backend, and set JWT. Adds a library
to read and set cookies.

Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
Removes OAuth button from home page, and redesigns it. Uses new
authorization functionality in auth.

Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
Dynamically displays an auth button in place of the submit button if
needed, and adds full authorization flow.

Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
@HassanAbouelela HassanAbouelela added priority: high status: stalled Something is blocking further progress type: feature A request for or implementation of a new feature labels Feb 12, 2021
Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>

# Conflicts:
#	package.json
#	src/commonStyles.tsx
#	src/pages/FormPage.tsx
Adds automatic token refresh, and removes manual setting of JWT.

Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
Explicitly sets the path attribute of username and scope cookies, to
ensure they work correctly across page transitions, and to match the
actual authorization cookie.

Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
@HassanAbouelela HassanAbouelela marked this pull request as ready for review March 6, 2021 19:58
@HassanAbouelela HassanAbouelela removed the status: stalled Something is blocking further progress label Mar 6, 2021
Extends username expiry to a very far date, to prevent it from expiring
on session.

Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Mar 6, 2021

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7e0d4a9
Status:               ✅  Deploy successful!
Preview URL:    https://24b01ef3.forms-frontend.pages.dev
View logs

Fixes the centering of the return home button on closed forms, by
removing the style wrapper.

Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>

# Conflicts:
#	package.json
# yarn.lock
Copy link
Copy Markdown
Member

@jb3 jb3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few notes, otherwise looks good and works great.

Comment thread src/api/auth.ts
Comment thread src/api/auth.ts Outdated
Comment thread src/api/auth.ts
HassanAbouelela and others added 2 commits March 7, 2021 17:21
Co-authored-by: Joe Banks <joseph@josephbanks.me>
Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com>
@jb3 jb3 merged commit 4a70423 into main Mar 7, 2021
@jb3 jb3 deleted the discord-oauth branch March 7, 2021 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: high type: feature A request for or implementation of a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants