Skip to content

Empty Authorization Form#90

Merged
HassanAbouelela merged 1 commit into
mainfrom
auth-form
Jun 20, 2021
Merged

Empty Authorization Form#90
HassanAbouelela merged 1 commit into
mainfrom
auth-form

Conversation

@HassanAbouelela
Copy link
Copy Markdown
Contributor

The first thing a developer might want to do when setting up the backend is to add a form. Adding a form requires you have your authorization cookie. Getting your authorization cookie requires clicking the discord OAuth button at the bottom of a form. This creates a sort of chicken-or-egg situation.

This PR aims to resolve that by returning a fake form when the backend contains no forms, and the server is running with the PRODUCTION flag set to false.

A better alternative would be to have the DB be created with that form, so we don't have to code in a special case for it, but that didn't seem feasible with mongo. There is no equivalent to something like init.sql as far as I could tell.

Returns a form with no questions, if the server is not running in
production, and no other forms are found, to aid in setting up.

Signed-off-by: Hassan Abouelela <hassan@hassanamr.com>
@HassanAbouelela HassanAbouelela added area: authentication Code relating to authentication with the backend service, typically for admin only routes. type: feature A new feature that should be added to the application. labels May 17, 2021
@HassanAbouelela HassanAbouelela requested review from jb3 and ks129 as code owners May 17, 2021 17:23
@HassanAbouelela HassanAbouelela merged commit b327873 into main Jun 20, 2021
@HassanAbouelela HassanAbouelela deleted the auth-form branch June 20, 2021 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: authentication Code relating to authentication with the backend service, typically for admin only routes. type: feature A new feature that should be added to the application.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant