Skip to content

Commit

Permalink
Add ExchangeCodeForSession to StatelessClient (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbakker committed Jul 15, 2024
1 parent 128da5e commit ee21531
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Gotrue/Interfaces/IGotrueStatelessClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,16 @@ public interface IGotrueStatelessClient<TUser, TSession>
/// <param name="options"></param>
/// <returns></returns>
Task<bool> DeleteUser(string uid, string serviceRoleToken, StatelessClientOptions options);


/// <summary>
/// Logs in an existing user via a third-party provider.
/// </summary>
/// <param name="codeVerifier"></param>
/// <param name="authCode"></param>
/// <param name="options"></param>
/// <returns></returns>
Task<TSession?> ExchangeCodeForSession(string codeVerifier, string authCode, StatelessClientOptions options);

/// <summary>
/// Initialize/retrieve the underlying API for this client
/// </summary>
Expand Down
6 changes: 6 additions & 0 deletions Gotrue/StatelessClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,12 @@ public async Task<bool> DeleteUser(string uid, string serviceRoleToken, Stateles
return true;
}

/// <inheritdoc />
public async Task<Session?> ExchangeCodeForSession(string codeVerifier, string authCode, StatelessClientOptions options)
{
return await GetApi(options).ExchangeCodeForSession(codeVerifier, authCode);
}

/// <inheritdoc />
public async Task<Session?> GetSessionFromUrl(Uri uri, StatelessClientOptions options)
{
Expand Down

0 comments on commit ee21531

Please sign in to comment.