Empty Authorization Form#90
Merged
Merged
Conversation
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>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
PRODUCTIONflag 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.sqlas far as I could tell.