Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions templates/unity/Assets/Runtime/AppwriteConfig.cs.twig
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ namespace {{ spec.title | caseUcfirst }}
public class {{ spec.title | caseUcfirst }}Config : ScriptableObject
{
[Header("Connection Settings")]
[Tooltip("Endpoint URL for {{ spec.title | caseUcfirst }} API (e.g., https://cloud.{{ spec.title | caseUcfirst }}.io/v1)")]
[SerializeField] private string endpoint = "https://cloud.{{ spec.title | caseUcfirst }}.io/v1";
[Tooltip("Endpoint URL for {{ spec.title | caseUcfirst }} API (e.g., https://cloud.{{ spec.title | lower }}.io/v1)")]
[SerializeField] private string endpoint = "https://cloud.{{ spec.title | lower }}.io/v1";

[Tooltip("WebSocket endpoint for realtime updates (optional)")]
[SerializeField] private string realtimeEndpoint = "wss://cloud.{{ spec.title | caseUcfirst }}.io/v1";
[SerializeField] private string realtimeEndpoint = "wss://cloud.{{ spec.title | lower }}.io/v1";

[Tooltip("Enable if using a self-signed SSL certificate")]
[SerializeField] private bool selfSigned;
Expand Down
8 changes: 4 additions & 4 deletions templates/unity/base/requests/oauth.twig
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@

// Use domain from callback if available, otherwise fallback to endpoint host
var domain = !string.IsNullOrEmpty(callbackDomain) ? callbackDomain : new Uri(_client.Endpoint).Host;

var parsedDomain = domain.StartsWith(".") ? domain.Substring(1) : domain;
// Create a Set-Cookie header format and parse it
// This ensures consistent cookie processing with server responses
var setCookieHeader = $"{key}={secret}; Path=/; Domain={domain}; Secure; HttpOnly; Max-Age={30 * 24 * 60 * 60}";
Debug.Log($"Setting cookie: {setCookieHeader} for domain: {domain}");
_client.CookieContainer.ParseSetCookieHeader(setCookieHeader, domain.StartsWith(".") ? domain.Substring(1) : domain);
var setCookieHeader = $"{key}={secret}; Path=/; Domain={parsedDomain}; Secure; HttpOnly; Max-Age={30 * 24 * 60 * 60}";
Debug.Log($"Setting cookie: {setCookieHeader} for domain: {parsedDomain}");
_client.CookieContainer.ParseSetCookieHeader(setCookieHeader, parsedDomain);

#if UNITY_EDITOR
Debug.LogWarning("[Appwrite] OAuth authorization in Editor: you can open and authorize, but cookies cannot be obtained. The session will not be set.");
Expand Down