-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Fix: 404 on Hydra Oauth page #4835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: 404 on Hydra Oauth page #4835
Conversation
…rce/reaction into fix-4794-impactmass-idp-route-notfound
…ogin permission to fix login 404
|
Generally we never want to change a migration after it's been created. This may be a rare case when it's ok, but I'll have to give it some thought. If there's any way to just fix the migration to still do the same thing it was originally needed for, but without interfering with new groups, that would be preferable. |
|
I share the same concern about not removing the migration. Flashing back, I see that the migration was added as a path for Reaction apps that existed before the introduction of Groups. I'll take a look now at how we can still keep that without the side effect we are currently getting |
|
I find that: Migration 5 needs to be smarter. It currently assumes that every install it gets called on is coming from a pre-Groups version of Reaction. That is not always true (e.g in the case of this issue). It needs to confirm that there are no correctly setup Groups, before it tries to run. @dancastellon we can sync on this. |
|
This is partly a flaw with the current migration system. It should be possible to mark the current DB version while seeding it, so that migrations that are unnecessary don't run. However, we're replacing the migration system soon so if we can work around this flaw for now, that's the best solution. |
|
@aldeed - @impactmass and I discussed what to do to keep the migration, and he just pushed a fix. Can you take another look? Thanks! |
aldeed
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a good solution. Just one suggestion
imports/plugins/core/versions/server/migrations/5_update_defaultRoles_to_groups.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aldeed I addressed your comment in the migration file.
I'm approving since I was listed as reviewer when it was created. Good by you to merge?
|
Merging on @impactmass approval and @aldeed's review with a single suggestion. |
Resolves #4794
Impact: major
Type: bugfix
Issue Description
OAuth IDP login pages created by the Hydra plugin are not showing up in the latest release candidate 6. So
/account/loginreturns Not Found. Going back a few commits (e.gd37e12b2ea92), the page shows up fine.Solution
Calling
Reaction.addRolesToGroups()to add the "account/login" permission to guest & customer groups was the first step. This was called in anafterCoreInitevent callback in the hydra-oauth core plugin (see @impactmass's original PR - https://github.com/reactioncommerce/reaction/pull/4795/files)Even with that, it was taking 2 server restarts before the account/login view was working (not returning a 404). I traced this down to Migration 5 - which was deleting and recreating all groups. Because we now have a core
createGroupsfunction that does this before the migrations run, this migration is no longer needed.Breaking changes
None
Testing
reaction reset -n