sourcefuse / loopback4-starter

Loopback 4 starter application. Multi-tenant architecture supported. Authentication, Authorization, Soft deletes, environment vars, Audit logs, included.
MIT License
158 stars 59 forks source link

What does a release mean exactly? If I already have cloned the code and started to use it? #15

Closed vikramkh closed 5 years ago

vikramkh commented 5 years ago

If I already started to use the code in a cloned repo, how should i handle the release? Sorry I'm very unfamiliar with git

samarpan-b commented 5 years ago

After you clone a repo from github, you need to change the remote url of that, if you want to do any changes and push to your own repo. Here is how to do that - https://help.github.com/en/articles/changing-a-remotes-url

For understanding a release, there are 2 ways to do that.

  1. Tagging in git - https://git-scm.com/book/en/v2/Git-Basics-Tagging
  2. Creating a release using a tag on github - https://help.github.com/en/articles/creating-releases

Just remember, github is just a client running git underneath. So all git specific stuff possible in github repo. Tagging is a feature of marking a release in Git. Hope this helps.

vikramkh commented 5 years ago

I ran an npm update on my cloned repo, and I got this error now: { "error": { "statusCode": 401, "name": "UnauthorizedError", "message": { "message": "VerifyFunction.OauthClientPasswordFn is not implemented" } } }

What does this mean?

samarpan-b commented 5 years ago

Yeah. Actually I did a breaking change in loopback4-authentication package latest version. Integrated it into loopback4-starter as well. But you only took an update of authentication package. That's why the issue. To fix it, just change below in application.ts,

// Add authentication component
    this.component(AuthenticationComponent);
    // Customize authentication verify handlers
    this.bind(Strategies.Passport.OAUTH2_CLIENT_PASSWORD_VERIFIER).toProvider(
      ClientPasswordVerifyProvider,
    );
    this.bind(Strategies.Passport.LOCAL_PASSWORD_VERIFIER).toProvider(
      LocalPasswordVerifyProvider,
    );
    this.bind(Strategies.Passport.BEARER_TOKEN_VERIFIER).toProvider(
      BearerTokenVerifyProvider,
    );
    this.bind(Strategies.Passport.RESOURCE_OWNER_PASSWORD_VERIFIER).toProvider(
      ResourceOwnerVerifyProvider,
    );
    this.bind(Strategies.Passport.GOOGLE_OAUTH2_VERIFIER).toProvider(
      GoogleOauth2VerifyProvider,
    );

Basically move your component bind statement to before the verifier bindings like above. Hope this helps.

samarpan-b commented 5 years ago

I am still learning on how to manage versions of packages along with this starter project. Hope you understand.

vikramkh commented 5 years ago

No worries at all. I myself am very new to this and really do appreciate your responsiveness. That worked perfectly thank you very much. I'll close this thread so that there are no active issues, but on a side note, if you get some free time, do you mind explaining what the google auth component does?

samarpan-b commented 5 years ago

@vikramkh For understanding on how to integrate with google auth, refer to the docs here - https://github.com/sourcefuse/loopback4-authentication#google-oauth-2