Skip to content

Local Authentication with custom usernameField not recognized  #177

@jondmoon

Description

@jondmoon

This could be due to me not understanding how it works, but I have set up a Feathers 5 API with local authentication, and set the usernameField to "username" instead of email in the config. But my Nuxt client is showing a typescript error because "username" is not in the AuthenticateData type. I couldn't figure out what I could do to get this to read the correct parameter. All I've done is created a fresh API server, added a few blank services, then built the client. I imported that client and went through the other setup pieces for Nuxt to get the authentication set up and everything seemed like it was working until I tried to actually add the authentication.

Here's the config in my API:
"authentication": {
"entity": "user",
"service": "users",
"local": {
"usernameField": "username",
"passwordField": "password"
},
"authStrategies": [
"jwt",
"local"
]
}

And in my Nuxt code I have all of the boilerplate from the Nuxt setup instructions, plus this line which is where it has the error:
await auth.authenticate({ strategy: 'local', username: '', password: '' })

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions