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

Adding firebase 3.x authentication methods #882

Closed

Conversation

idanen
Copy link
Contributor

@idanen idanen commented Nov 17, 2016

Description

Adding the ability to link a user to a new user with email and password.

Code sample

angular.module('some-module', ['firebase'])
  .controller('MyCtrl', function MyCtrl($fireabseAuth) {
    this.authObj = $firebaseAuth();
    // ... Assuming user logged in somehow. Anonymously, or with other credentials
    this.user = this.authObj.$getAuth();

    // ... other logic ...

    // This could be linked to some `ng-click` for example
    this.linkUser = function (email, password) {
        this.authObj.$linkUser(email, password)
            .then(function (authData) {
                // This will not trigger a `$digest`, so do so if needed using `$timeout`, `$scope.$apply` or whatever suits you.
                this.user = authData;
            }.bind(this));
    };

    // Another way to get the user: listening to `$onAuthStateChanged`
    this.authObj.$onAuthStateChanged(function(firebaseUser) {
      if (firebaseUser) {
        console.log("Signed in as:", firebaseUser.uid);
        this.user = firebaseUser;
      } else {
        console.log("Signed out");
        this.user = undefined;
      }
    });
  });

Add the $linkUser method. #764

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.

1 similar comment
@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.

@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

1 similar comment
@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@RWOverdijk
Copy link

Can we just all agree that CLAs and weird licenses suck?

What's the status on this?

@idanen
Copy link
Contributor Author

idanen commented May 23, 2017

Looked at the commit I pushed back then. Turns out I had my git config with my work email which I no longer have access to 🙁
I'll try to merge the same commit with the correct config

@RWOverdijk
Copy link

@idanen thank you! :)

@idanen
Copy link
Contributor Author

idanen commented May 23, 2017

No luck merging the same commit.

Submitted a new PR with the same change (but more tests 😊).

Take a look at the issue, I think the path to implement isn't decided yet.
The PR is kind of a suggestion, not sure it's the best path.

@idanen
Copy link
Contributor Author

idanen commented May 23, 2017

Lost access to the email I made this PR with, so closing...

Made a new PR #932

@idanen idanen closed this May 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet