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:
parent
b9a5060882
commit
32b28df2d2
4 changed files with 40 additions and 3 deletions
|
@ -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;
|
||||
|
|
|
@ -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>
|
||||
|
|
Reference in a new issue