public async Task <ActionResult <UserDto> > GoogleLogin(GoogleUserDto loginDto)
        {
            var command = new GoogleLoginCommand(loginDto, this);
            var result  = await _mediator.Send(command);

            return(result);
        }
Ejemplo n.º 2
0
 public async Task <LoginResponseDto> Authenticate(string idToken, GoogleUserDto user)
 {
     return(await PostAsync <LoginResponseDto>("login/authenticate", new LoginDto {
         GoogleIdToken = idToken,
         User = user,
     }));
 }
Ejemplo n.º 3
0
        private void OnSignInSuccessful(GoogleSignInAccount userAccount)
        {
            GoogleUserDto user = new GoogleUserDto {
                Id         = userAccount.Id,
                Name       = userAccount.DisplayName,
                GivenName  = userAccount.GivenName,
                FamilyName = userAccount.FamilyName,
                Email      = userAccount.Email,
                Picture    = new Uri(userAccount.PhotoUrl != null ? $"{userAccount.PhotoUrl}" : string.Empty),
            };

            idToken = userAccount.IdToken;

            var googleArgs = new GoogleClientResultEventArgs(user, GoogleActionStatus.Completed);

            loginTcs.TrySetResult(new GoogleResponse(googleArgs));
        }
Ejemplo n.º 4
0
 public GoogleLoginCommand(GoogleUserDto googleUserDto, AccountController controller)
 {
     GoogleUserDto = googleUserDto;
     Controller    = controller;
 }
Ejemplo n.º 5
0
 public GoogleClientResultEventArgs(GoogleUserDto user, GoogleActionStatus status, string msg = "")
 {
     User    = user;
     Status  = status;
     Message = msg;
 }