Skip to content

Commit c294111

Browse files
committed
Fix the session reload
1 parent fa622bb commit c294111

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

API.Test/AuthentificationTests.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,13 @@ public void GetSessionExpiresDateTime()
5454
_ = client.SessionExpires;
5555
_ = client.SessionBegin;
5656
}
57+
58+
[Test]
59+
public void ReloadSessionTokenTest()
60+
{
61+
using WebUntisClient client = new("WebUntisAPI_TEST", TimeSpan.FromSeconds(5));
62+
client.LoginAsync(s_Server, s_LoginName, s_UserName, s_Password).Wait();
63+
64+
client.ReloadSessionAsync().Wait();
65+
}
5766
}

WebUntisAPI.Client/WebUntisAPI.Client.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
<Copyright>Copyright © Suiram1 2023</Copyright>
1717
<Description>A library in .NET to interact with the WebUntis API.</Description>
1818
<Company>Suiram1</Company>
19-
<AssemblyVersion>1.2.1</AssemblyVersion>
20-
<FileVersion>1.2.1</FileVersion>
21-
<Version>1.2.1</Version>
19+
<AssemblyVersion>1.2.2</AssemblyVersion>
20+
<FileVersion>1.2.2</FileVersion>
21+
<Version>1.2.2</Version>
2222
</PropertyGroup>
2323

2424
<ItemGroup>

WebUntisAPI.Client/WebUntisClient.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,7 @@ public async Task ReloadSessionAsync(CancellationToken ct = default)
474474
};
475475
request.Headers.Add("JSESSIONID", _sessionId);
476476
request.Headers.Add("schoolname", _schoolName);
477+
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", _bearerToken);
477478

478479
HttpResponseMessage response = await _client.SendAsync(request, ct);
479480

0 commit comments

Comments
 (0)