This repository has been archived by the owner on Oct 8, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Login): new browser approval - assuming user is in the same browser
- Loading branch information
Showing
5 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
angular | ||
.module('walletApp') | ||
.controller("AuthorizeApproveCtrl", AuthorizeApproveCtrl); | ||
|
||
function AuthorizeApproveCtrl($window, $scope, Wallet, $stateParams, $state, Alerts, $translate) { | ||
const success = (uid) => { | ||
|
||
$window.close(); // This is sometimes ignored, hence the code below: | ||
|
||
if(uid) { | ||
$translate('AUTHORIZE_APPROVE_SUCCESS').then(translation => { | ||
$state.go("public.login-uid", {uid: uid}).then(() => { | ||
Alerts.displaySuccess(translation) | ||
}); | ||
}); | ||
} else { | ||
$translate('AUTHORIZE_APPROVE_SUCCESS').then(translation => { | ||
$state.go("public.login-no-uid").then(() => { | ||
Alerts.displaySuccess(translation) | ||
}); | ||
}); | ||
} | ||
|
||
|
||
} | ||
|
||
const error = (message) => { | ||
$state.go("public.login-no-uid"); | ||
Alerts.displayError(message, true); | ||
} | ||
|
||
Wallet.authorizeApprove($stateParams.token, success, error) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters