Exemple #1
0
        public async Task IssueAuthenticationTokens(HttpResponse Response, UserModel user)
        {
            var oldToken = await _RefreshTokenManager.GetOneByUserIdAsync(user.Id);

            var authorizationToken = GenerateAuthenticationToken(user.Username);

            _CookieService.AppendAuthenticationCookie(Response, authorizationToken);

            var newToken = GenerateAuthenticationRefreshToken();

            _CookieService.AppendRefreshAuthenticationCookie(Response, newToken.Token);

            await _RefreshTokenManager.UpdateAsync(oldToken.Token, newToken);
        }