Skip to content

Commit

Permalink
Fix XML doc (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonashendrickx authored Sep 25, 2023
1 parent ae7056b commit 960ed48
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions src/Passwordless/Helpers/Base64UrlConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,18 @@

namespace Passwordless;

/// <summary>
/// encode/decode byte array to/from base64url encoded string
/// </summary>
public sealed class Base64UrlConverter : JsonConverter<byte[]>
{
/// <summary>
/// decode base64url encoded string to byte array
/// </summary>
/// <param name="reader"></param>
/// <param name="typeToConvert"></param>
/// <param name="options"></param>
/// <returns></returns>
public override byte[] Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
if (!reader.HasValueSequence)
Expand All @@ -14,6 +24,12 @@ public override byte[] Read(ref Utf8JsonReader reader, Type typeToConvert, JsonS
return Base64Url.Decode(reader.GetString().AsSpan());
}

/// <summary>
/// encode byte array to base64url encoded string
/// </summary>
/// <param name="writer"></param>
/// <param name="value"></param>
/// <param name="options"></param>
public override void Write(Utf8JsonWriter writer, byte[] value, JsonSerializerOptions options)
{
writer.WriteStringValue(Base64Url.Encode(value));
Expand Down
2 changes: 1 addition & 1 deletion src/Passwordless/IPasswordlessClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public interface IPasswordlessClient
/// <summary>
/// Attempts to delete a credential via the supplied id.
/// </summary>
/// <param name="id">The id of a credential representing as a Base64 URL encoded <see cref="byte[]" />.</param>
/// <param name="id">The id of a credential representing as a Base64 URL encoded <see cref="T:byte[]" />.</param>
/// <param name="cancellationToken"></param>
/// <returns>A task object representing the asynchronous operation.</returns>
/// <exception cref="PasswordlessApiException">An exception containing details abaout the reason for failure.</exception>
Expand Down

0 comments on commit 960ed48

Please sign in to comment.