Skip to content
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

Fails to set a global route auth config #2940

Merged
merged 2 commits into from Nov 21, 2015
Merged

Fails to set a global route auth config #2940

merged 2 commits into from Nov 21, 2015

Conversation

@giovannicalo
Copy link
Contributor

@giovannicalo giovannicalo commented Nov 11, 2015

After the recent special routes changes, a server configured to use an authentication strategy by default for all routes...

const server = new Hapi.Server({ connections: { routes: { auth: "foo" } });
server.connection(...);
...
server.auth.strategy("foo", ..., ...);

... would fail to start and instead throw an error.

Unknown authentication strategy: foo in path: /{p*}

I also doubt the special routes are supposed to require authentication in the first place, as they didn't till the aforementioned commit.

This fixes it.

However, it might be better to just ignore authentication-related options for routes where method === "_special", instead of passing config: { auth: false } every time.

@gergoerdosi
Copy link
Contributor

@gergoerdosi gergoerdosi commented Nov 11, 2015

Can you add a test that fails without your changes and passes with them?

@hueniverse hueniverse changed the title Fixed an issue where special routes would attempt to validate authentication if set globally Fails to set a global route auth config Nov 21, 2015
@hueniverse hueniverse added the bug label Nov 21, 2015
@hueniverse hueniverse added this to the 11.1.2 milestone Nov 21, 2015
@hueniverse hueniverse self-assigned this Nov 21, 2015
hueniverse added a commit that referenced this issue Nov 21, 2015
Fails to set a global route auth config
@hueniverse hueniverse merged commit a17d1bf into hapijs:master Nov 21, 2015
1 check passed
hueniverse added a commit that referenced this issue Nov 21, 2015
@lock
Copy link

@lock lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants