Skip to content

Commit

Permalink
Rename Sso to SSO in codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
acupofjose committed May 31, 2024
1 parent 5acd1b2 commit d47375e
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions Gotrue/Api.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public async Task<PasswordlessSignInState> SignInWithOtp(SignInWithPasswordlessP
return Helpers.MakeRequest<Session>(HttpMethod.Post, $"{Url}/token?grant_type=id_token", body, Headers);
}

private Task<SsoResponse?> SignInWithSsoInternal(Guid? providerId = null, string? domain = null, SignInOptionsWithSsoOptions? options = null)
private Task<SSOResponse?> SignInWithSsoInternal(Guid? providerId = null, string? domain = null, SignInWithSSOOptions? options = null)
{
if(providerId != null && domain != null)
throw new GotrueException($"Both providerId and domain were provided to the API, " +
Expand Down Expand Up @@ -286,17 +286,17 @@ public async Task<PasswordlessSignInState> SignInWithOtp(SignInWithPasswordlessP
if (!string.IsNullOrEmpty(options?.CaptchaToken))
body.Add("gotrue_meta_security", new Dictionary<string, object?> { { "captcha_token", options?.CaptchaToken } });

return Helpers.MakeRequest<SsoResponse>(HttpMethod.Post, $"{Url}/sso", body, Headers);
return Helpers.MakeRequest<SSOResponse>(HttpMethod.Post, $"{Url}/sso", body, Headers);
}

/// <inheritdoc />
public Task<SsoResponse?> SignInWithSso(Guid providerId, SignInOptionsWithSsoOptions? options = null)
public Task<SSOResponse?> SignInWithSSO(Guid providerId, SignInWithSSOOptions? options = null)
{
return SignInWithSsoInternal(providerId: providerId, options: options);
}

/// <inheritdoc />
public Task<SsoResponse?> SignInWithSso(string domain, SignInOptionsWithSsoOptions? options = null)
public Task<SSOResponse?> SignInWithSSO(string domain, SignInWithSSOOptions? options = null)
{
return SignInWithSsoInternal(domain: domain, options: options);
}
Expand Down
8 changes: 4 additions & 4 deletions Gotrue/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -296,25 +296,25 @@ public Task<ProviderAuthState> SignIn(Provider provider, SignInOptions? options
}

/// <inheritdoc />
public Task<SsoResponse?> SignInWithSso(Guid providerId, SignInOptionsWithSsoOptions? options = null)
public Task<SSOResponse?> SignInWithSSO(Guid providerId, SignInWithSSOOptions? options = null)
{
if (!Online)
throw new GotrueException("Only supported when online", Offline);

DestroySession();

return _api.SignInWithSso(providerId, options);
return _api.SignInWithSSO(providerId, options);
}

/// <inheritdoc />
public Task<SsoResponse?> SignInWithSso(string domain, SignInOptionsWithSsoOptions? options = null)
public Task<SSOResponse?> SignInWithSSO(string domain, SignInWithSSOOptions? options = null)
{
if (!Online)
throw new GotrueException("Only supported when online", Offline);

DestroySession();

return _api.SignInWithSso(domain, options);
return _api.SignInWithSSO(domain, options);
}

/// <inheritdoc />
Expand Down
4 changes: 2 additions & 2 deletions Gotrue/Interfaces/IGotrueApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public interface IGotrueApi<TUser, TSession> : IGettableHeaders
Task<PasswordlessSignInState> SignInWithOtp(SignInWithPasswordlessEmailOptions options);
Task<PasswordlessSignInState> SignInWithOtp(SignInWithPasswordlessPhoneOptions options);
Task<TSession?> SignInAnonymously(SignInAnonymouslyOptions? options = null);
Task<SsoResponse?> SignInWithSso(Guid providerId, SignInOptionsWithSsoOptions? options = null);
Task<SsoResponse?> SignInWithSso(string domain, SignInOptionsWithSsoOptions? options = null);
Task<SSOResponse?> SignInWithSSO(Guid providerId, SignInWithSSOOptions? options = null);
Task<SSOResponse?> SignInWithSSO(string domain, SignInWithSSOOptions? options = null);
Task<BaseResponse> SignOut(string jwt);
Task<TSession?> SignUpWithEmail(string email, string password, SignUpOptions? options = null);
Task<TSession?> SignUpWithPhone(string phone, string password, SignUpOptions? options = null);
Expand Down
4 changes: 2 additions & 2 deletions Gotrue/Interfaces/IGotrueClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ public interface IGotrueClient<TUser, TSession> : IGettableHeaders
/// <param name="providerId">The guid of the provider you wish to use, obtained from running supabase sso list from the CLI</param>
/// <param name="options">The redirect uri and captcha token, if any</param>
/// <returns>The Uri returned from supabase auth that a user can use to sign in to their given SSO provider (okta, microsoft entra, gsuite ect...)</returns>
Task<SsoResponse?> SignInWithSso(Guid providerId, SignInOptionsWithSsoOptions? options = null);
Task<SSOResponse?> SignInWithSSO(Guid providerId, SignInWithSSOOptions? options = null);

/// <summary>
/// Sign in using single sign on (SSO) as supported by supabase
Expand All @@ -291,7 +291,7 @@ public interface IGotrueClient<TUser, TSession> : IGettableHeaders
/// </param>
/// <param name="options">The redirect uri and captcha token, if any</param>
/// <returns>The Uri returned from supabase auth that a user can use to sign in to their given SSO provider (okta, microsoft entra, gsuite ect...)</returns>
Task<SsoResponse?> SignInWithSso(string domain, SignInOptionsWithSsoOptions? options = null);
Task<SSOResponse?> SignInWithSSO(string domain, SignInWithSSOOptions? options = null);

/// <summary>
/// Logs in an existing user via a third-party provider.
Expand Down
4 changes: 2 additions & 2 deletions Gotrue/SsoResponse.cs → Gotrue/SSOResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ namespace Supabase.Gotrue
/// <summary>
/// Single sign on (SSO) response data deserialized from the API {supabaseAuthUrl}/sso
/// </summary>
public class SsoResponse : ProviderAuthState
public class SSOResponse : ProviderAuthState
{
/// <summary>
/// Deserialized response from {supabaseAuthUrl}/sso
/// </summary>
/// <param name="uri">Uri from the response, this will open the SSO providers login page and allow a user to login to their provider</param>
public SsoResponse(Uri uri) : base(uri) { }
public SSOResponse(Uri uri) : base(uri) { }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Supabase.Gotrue
/// <summary>
/// Options used for signing in a user using single sign on (SSO).
/// </summary>
public class SignInOptionsWithSsoOptions : SignInOptions
public class SignInWithSSOOptions : SignInOptions
{
/// <summary>
/// Verification token received when the user completes the captcha on the site.
Expand Down

0 comments on commit d47375e

Please sign in to comment.