Giter VIP home page Giter VIP logo

Comments (7)

csvan avatar csvan commented on August 19, 2024

I ran into a similar problem when trying to get this component to work with the Angular SDK. The problem, as you correctly point out, is that the User.login() function is never invoked when using the local strategy, and hence no validation is carried out, and (importantly for the Angular SDK), no access token is ever generated.

I have currently hacked the component for our internal work, I hope to release these changes as a pull request during the coming weeks depending on how things turn out.

from loopback-component-passport.

dstroot avatar dstroot commented on August 19, 2024

Thanks for letting me know! Hope to see the PR.

from loopback-component-passport.

csvan avatar csvan commented on August 19, 2024

#32

from loopback-component-passport.

britztopher avatar britztopher commented on August 19, 2024

Actually if you set your 'setAccessToken' flag in your providers.json file like so, it will use the User.login function like so

"local": {
"provider": "local",
"module": "passport-local",
"usernameField": "email",
"passwordField": "password",
"authPath": "/auth/local",
"successRedirect": "/auth/account",
"failureRedirect": "/login",
"setAccessToken": true
},

But just make sure your username is used for login, as I am using email as login cred, and username is hardcoded in passport-configurator.js file.

from loopback-component-passport.

dstroot avatar dstroot commented on August 19, 2024

I think the pull request above your comment is the one that added "setAccessToken": true

Shame that username is hardcoded as I also use email as the user id.

from loopback-component-passport.

britztopher avatar britztopher commented on August 19, 2024

@dstroot I just added a ticket to see if we can do something about it found here #34

from loopback-component-passport.

dstroot avatar dstroot commented on August 19, 2024

@britztopher - great! Thanks for that.

from loopback-component-passport.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.