Esempio n. 1
0
        public async Task <ActionResult <object> > GoogleLogin([FromBody] LoginGoogleRequestVM request)
        {
            var user = await this.authenticateService.AuthenticateThrowGoogleAsync(request.GoogleJwtToken);

            var token = CustomJwtCreator.CreateJwt(user.Id);

            return(new
            {
                user,
                token
            });
        }
Esempio n. 2
0
        public async Task <ActionResult <object> > Login([FromBody] LoginRequestVM loginRequest)
        {
            var user = await authenticateService.LoginAsync(loginRequest.Email, loginRequest.Password);

            var authJwtToken = CustomJwtCreator.CreateJwt(user.Id);

            return(new
            {
                user,
                token = authJwtToken
            });
        }