Skip to content

Commit 0c07e3d

Browse files
small fixes
1 parent a8f502c commit 0c07e3d

6 files changed

Lines changed: 10 additions & 10 deletions

File tree

HwProj.AuthService/HwProj.AuthService.API/Controllers/AccountController.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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}")]

HwProj.AuthService/HwProj.AuthService.API/Services/AccountService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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)

HwProj.AuthService/HwProj.AuthService.API/Services/AuthTokenService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

HwProj.AuthService/HwProj.AuthService.API/Services/IAccountService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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);

HwProj.AuthService/HwProj.AuthService.API/Services/IAuthTokenService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

hwproj.front/src/components/Courses/Statistics/StudentStatsChart.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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="Ссылка скопирована"/>

0 commit comments

Comments
 (0)