allow null setting for domain#65
Conversation
|
yep, +1 ) |
lib/index.js
Outdated
There was a problem hiding this comment.
Since Statehood sets domain to null via defaults, this isn't needed.
There was a problem hiding this comment.
Sure, that makes sense. It's worth pointing out though, that with the validation happening first there's no way to trigger that branch of logic -- no falsey value will pass validation for domain, presently.
|
@mshick include changes for |
|
@gansbrest Do you have an specific property and falsey value which you need support for? |
|
Okay, will do. I’ll push up the validation change in a sec, along with a test. I don’t mean to badger you. If redirectTo isn’t a change you want to make I understand.
|
|
Should domain also be changed to allow false? |
|
Null is allowed by statehood, false is not. That's the rationale -- consistency.
|
There was a problem hiding this comment.
I used false to be consistent with the docs for redirectTo at the route level:
To set an individual route to use or disable redirections, use the route plugins config ({ config: { plugins: { 'hapi-auth-cookie': { redirectTo: false } } } }). Defaults to no redirection.
In light of that, would you still like me to change it?
There was a problem hiding this comment.
You're right, the allow value will override the data type.
> Joi.validate(false, Joi.string().allow(false))
{ error: null, value: false }|
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. |
Per #64 allows domains to be set to
nullan allowed value forserver.state.