Guest User

Untitled

a guest
Sep 26th, 2017
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $window.auth2.grantOfflineAccess({redirect_uri: 'postmessage', prompt: 'select_account'}).then(handleAuth2Result);
  2.  
  3. function handleAuth2Result(response) {
  4.   LoginService.googleUserAuth(response).then(startSession);
  5. }
  6.  
  7. function startSession(userInfo) {
  8.   AccountService.getProfile().then(userProfileLoaded);
  9.  
  10.   function userProfileLoaded(user_profile) {
  11.     AccountService.getProfile().then(routeUser);      
  12.   }
  13. }
  14.  
  15. function routeUser(){
  16.   $state.go(INITIAL_ROUTE.route);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment