Bugfix: /api initial flag regression #201
Merged
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.
Fixed regression introduced on the develop branch's TS migration blocking initial admin user setup on first run.
We had missed the initial property on the /api endpoint's response which was being checked in Angular to see if zero users exist on the server, at which point we should route the user to the create an admin user flow instead of prompting them to login (as it currently works on master). This change replaces it, though it's leveraging the legacy JS user model for the moment for simplicity's sake.
Talking to Robert, there's an upcoming plan to migrate this behavior to a secret-based approach so we don't race to create the first admin user after installing and launching the server for the first time. But this unblocks the situation for now on wholly new installs until that lands.
Feel free to advise on any stylistic changes to fit how things ought to work as I haven't had a lot of mileage on TS in general and our mage-server stack in particular yet. :)