Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refresh Thread bug fixes, add offline support for stateful end user client. #63

Merged
merged 13 commits into from
Jun 17, 2023
10 changes: 10 additions & 0 deletions Gotrue/Api.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

namespace Supabase.Gotrue
{
/// <summary>
/// The REST calls to the Gotrue API.
/// </summary>
public class Api : IGotrueApi<User, Session>
{
private string Url { get; }
Expand All @@ -25,6 +28,9 @@ public class Api : IGotrueApi<User, Session>
public Func<Dictionary<string, string>>? GetHeaders { get; set; }

private Dictionary<string, string> _headers;
/// <summary>
/// Headers to be sent with every request. These will be merged with any headers returned by GetHeaders.
/// </summary>
protected Dictionary<string, string> Headers
{
get => GetHeaders != null ? GetHeaders().MergeLeft(_headers) : _headers;
Expand Down Expand Up @@ -585,6 +591,10 @@ public Task<BaseResponse> DeleteUser(string uid, string jwt)
return Helpers.MakeRequest(HttpMethod.Delete, $"{Url}/admin/users/{uid}", data, CreateAuthedRequestHeaders(jwt));
}

/// <summary>
/// Calls the GoTrue server to get the settings (for example, if email auto confirmation is turned on)
/// </summary>
/// <returns></returns>
public Task<Settings?> Settings()
{
return Helpers.MakeRequest<Settings>(HttpMethod.Get, $"{Url}/settings", null, Headers);
Expand Down
Loading