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

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

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

Comments

Projects
None yet
5 participants
@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

This comment has been minimized.

Copy link
Member

marshallswain commented Sep 24, 2016

@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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Author

Creiger commented Oct 4, 2016

@ekryski Yes, i am also running on Windows.

@sean-nicholas

This comment has been minimized.

Copy link

sean-nicholas commented Oct 20, 2016

@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

This comment has been minimized.

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 Oct 20, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.