Send a registration even for github created users. Alias their new username to their old mixpanel ID passed in the OAuth state parameter.

This commit is contained in:
yackob03 2013-10-10 17:32:32 -04:00
parent b9a5060882
commit 32b28df2d2
4 changed files with 40 additions and 3 deletions

View file

@ -141,6 +141,11 @@ function LandingCtrl($scope, $timeout, Restangular, UserService, KeyService) {
$scope.user = currentUser;
}, true);
angulartics.waitForVendorApi(mixpanel, 500, function(loadedMixpanel) {
var mixpanelId = loadedMixpanel.get_distinct_id();
$scope.github_state_clause = '&state=' + mixpanelId;
});
$scope.githubClientId = KeyService.githubClientId;
$scope.awaitingConfirmation = false;

View file

@ -47,7 +47,7 @@
<i class="icon-circle"></i>
<span class="inner-text">OR</span>
</span>
<a href="https://github.com/login/oauth/authorize?client_id={{ githubClientId }}&scope=user:email" class="btn btn-primary btn-block"><i class="icon-github icon-large"></i> Sign In with GitHub</a>
<a href="https://github.com/login/oauth/authorize?client_id={{ githubClientId }}&scope=user:email{{ github_state_clause }}" class="btn btn-primary btn-block"><i class="icon-github icon-large"></i> Sign In with GitHub</a>
<p class="help-block">No credit card required.</p>
</div>
</form>