File tree Expand file tree Collapse file tree
HwProj.AuthService/HwProj.AuthService.API
hwproj.front/src/components/Courses/Statistics Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -85,10 +85,10 @@ public async Task<IActionResult> RefreshToken(string userId)
8585
8686 [ HttpGet ( "getGuestToken" ) ]
8787 [ ProducesResponseType ( typeof ( TokenCredentials ) , ( int ) HttpStatusCode . OK ) ]
88- public async Task < TokenCredentials > GetGuestToken ( [ FromQuery ] string courseId )
88+ public Task < IActionResult > GetGuestToken ( [ FromQuery ] string courseId )
8989 {
90- var tokenMeta = await _accountService . GetGuestToken ( courseId ) ;
91- return tokenMeta ;
90+ var tokenMeta = _accountService . GetGuestToken ( courseId ) ;
91+ return Task . FromResult < IActionResult > ( Ok ( tokenMeta ) ) ;
9292 }
9393
9494 [ HttpPut ( "edit/{userId}" ) ]
Original file line number Diff line number Diff line change @@ -135,9 +135,9 @@ public async Task<Result<TokenCredentials>> RefreshToken(string userId)
135135 : await GetToken ( user ) ;
136136 }
137137
138- public async Task < TokenCredentials > GetGuestToken ( string courseId )
138+ public TokenCredentials GetGuestToken ( string courseId )
139139 {
140- return await _tokenService . GetTokenAsync ( courseId ) ;
140+ return _tokenService . GetGuestToken ( courseId ) ;
141141 }
142142
143143 public async Task < Result < TokenCredentials > > RegisterUserAsync ( RegisterDataDTO model )
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ public async Task<TokenCredentials> GetTokenAsync(User user)
5252 return tokenCredentials ;
5353 }
5454
55- public async Task < TokenCredentials > GetTokenAsync ( string courseId )
55+ public TokenCredentials GetGuestToken ( string courseId )
5656 {
5757 var securityKey = new SymmetricSecurityKey ( Encoding . ASCII . GetBytes ( _configuration [ "SecurityKey" ] ) ) ;
5858
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ public interface IAccountService
1616 Task < Result > EditAccountAsync ( string accountId , EditDataDTO model ) ;
1717 Task < Result < TokenCredentials > > LoginUserAsync ( LoginViewModel model ) ;
1818 Task < Result < TokenCredentials > > RefreshToken ( string userId ) ;
19- Task < TokenCredentials > GetGuestToken ( string courseId ) ;
19+ TokenCredentials GetGuestToken ( string courseId ) ;
2020 Task < Result > InviteNewLecturer ( string emailOfInvitedUser ) ;
2121 Task < IList < User > > GetUsersInRole ( string role ) ;
2222 Task < Result > RequestPasswordRecovery ( RequestPasswordRecoveryViewModel model ) ;
Original file line number Diff line number Diff line change @@ -7,6 +7,6 @@ namespace HwProj.AuthService.API.Services
77 public interface IAuthTokenService
88 {
99 Task < TokenCredentials > GetTokenAsync ( User user ) ;
10- Task < TokenCredentials > GetTokenAsync ( string courseId ) ;
10+ TokenCredentials GetGuestToken ( string courseId ) ;
1111 }
1212}
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ const StudentStatsChart: React.FC = () => {
6565 . flatMap ( h => h . tasks ! . map ( t => t . solution ! . length ) )
6666 setSectorSizes ( sectorSizes )
6767 }
68-
68+
6969 const userId = isLoggedIn ? ApiSingleton . authService . getUserId ( ) : undefined ;
7070 const isLecturer = userId != undefined && ApiSingleton . authService . isLecturer ( )
7171 && ! params . studentStatistics ?. map ( s => s . id ) . includes ( userId ) ;
@@ -149,7 +149,7 @@ const StudentStatsChart: React.FC = () => {
149149 </ Typography >
150150 { state . isLecturer &&
151151 < >
152- < IconButton onClick = { copyLink } >
152+ < IconButton onClick = { copyLink } size = "small" >
153153 < ShareIcon style = { { color : "#2979ff" } } />
154154 </ IconButton >
155155 < Snackbar open = { copied } message = "Ссылка скопирована" />
You can’t perform that action at this time.
0 commit comments