Skip to content

Commit

Permalink
Fixes bug when calculating expiration of token (#26)
Browse files Browse the repository at this point in the history
* expires in sets the ExpiresAt Value

* updated version numbers

---------

Co-authored-by: Daniel Espinosa <luespino@microsoft.com>
  • Loading branch information
danespinosa and Daniel Espinosa authored Jul 26, 2024
1 parent 4654d9c commit 1f04bbd
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/draftnewrelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Version 3.1.1.0
release_name: Version 3.2.0.0
body: |
- First Change
- Second Change
Expand Down
12 changes: 12 additions & 0 deletions Api/Entities/OAuthToken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,24 @@ namespace KoenZomers.Ring.Api.Entities
/// </summary>
public class OAutToken
{
private int _expiresInSeconds;

/// <summary>
/// The OAuth access token that can be used as a Bearer token to communicate with the Ring API
/// </summary>
[JsonPropertyName("access_token")]
public string AccessToken { get; set; }

/// <summary>
/// Gets the amount of seconds after creation of this OAuth token after which it expires
/// </summary>
[JsonPropertyName("expires_in")]
public int ExpiresInSeconds
{
get { return _expiresInSeconds; }
set { _expiresInSeconds = value; ExpiresAt = DateTime.Now.AddSeconds(value); }
}

/// <summary>
/// Gets a DateTime with when this token expires
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyCopyright("Koen Zomers")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/KoenZomers/RingRecordingDownload")]
[assembly: AssemblyVersion("3.1.1.0")]
[assembly: AssemblyVersion("3.2.0.0")]
2 changes: 1 addition & 1 deletion ConsoleAppCore/ConsoleAppCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<AssemblyName>RingRecordingDownload</AssemblyName>
<PackageId>KoenZomers.Ring.RecordingDownload</PackageId>
<Authors>Koen Zomers</Authors>
<Version>3.1.1.0</Version>
<Version>3.2.0.0</Version>
<Product>Ring Recording Download</Product>
<Description>Allows downloading of recordings from Ring devices from the Ring cloud to your local machine</Description>
<Copyright>Koen Zomers</Copyright>
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ Console application written in .NET 6 compiled for Windows, Raspberry Pi, Linux

## Version History

[3.2.0.0](https://github.com/KoenZomers/RingRecordingDownload/releases/tag/3.2.0.0) - July 26, 2024

- Fixes Token Expiration logic that throws session errors after the token expires.

[3.1.1.0](https://github.com/KoenZomers/RingRecordingDownload/releases/tag/3.1.1.0) - April 7, 2024

- Fixed typo in console application
Expand Down

0 comments on commit 1f04bbd

Please # to comment.