Skip to content
This repository was archived by the owner on Mar 22, 2022. It is now read-only.

"username" cannot be used as local strategy usernameField #294

Closed
Creiger opened this issue Sep 22, 2016 · 6 comments
Closed

"username" cannot be used as local strategy usernameField #294

Creiger opened this issue Sep 22, 2016 · 6 comments

Comments

@Creiger
Copy link

Creiger commented Sep 22, 2016

When i override local strategy settings with "usernameField" : "username", it does not work. If i use any other fieldname, it works. Is this some restriction?

@marshallswain
Copy link
Member

@Creiger not that I know of. Have you done any debugging to figure out the cause? If you can publish a repo with a breaking example we could be more helpful.

@sean-nicholas
Copy link

sean-nicholas commented Oct 3, 2016

Same here. When I'm calling app.get('auth') it looks like this:

{
    "local": {
        "usernameField": "Sean"
    }
}

It seems my config "usernameField": "username" is getting replaced by my computer username

EDIT: Found the issue: https://github.com/feathersjs/feathers-configuration/blob/master/src/index.js#L28
EDIT2: I'm using windows, maybe linux does not export the username in env

@ekryski
Copy link
Member

ekryski commented Oct 3, 2016

Wat! Ok thanks for the hunting @sean-nicholas. It's an issue with feathers-config or something that should be guarded against on windows. @Creiger are you running on windows?

@Creiger
Copy link
Author

Creiger commented Oct 4, 2016

@ekryski Yes, i am also running on Windows.

@sean-nicholas
Copy link

@Creiger There is actually a way to escape configs with \\ and therefore feathers does not look them up in the environment

{
    "local": {
        "usernameField": "\\username"
    }
}

@daffl
Copy link
Member

daffl commented Oct 20, 2016

I totally forgot about this! Thank you @sean-nicholas. It't is also documented here:

If the value starts with a , do none of the above two

So I think we can close this.

@daffl daffl closed this as completed Oct 20, 2016
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants