Skip to content

Login Solution and Scripts

gamedirection edited this page Aug 22, 2026 · 1 revision

Login Solution and Scripts

Affinity by Canva's sign-in used to crash the app under Wine. This page is the practical, action-first guide to the fix and its scripts. For the full root-cause trace and credits, see Related Projects: LoginFix.

The Fix

Install LoginFix, a community AffinityPluginLoader plugin. Short version:

  1. Install AffinityPluginLoader and WineFix first, if you haven't already.
  2. Copy AffinityPluginLoader.dll from your Affinity install directory into Guides/Wine/LoginFix (next to LoginFix.csproj).
  3. Run dotnet build -c Release.
  4. Copy the built bin/Release/net48/win-x64/LoginFix.dll into apl/plugins/, alongside WineFix.dll.
  5. Relaunch Affinity through Affinity.exe.

No custom Wine build needed. This works on your distro's stock Wine package. Full explanation of why the crash happened and why the fix works this way: Related Projects: LoginFix.

Scripts

LoginFix.dll (the fix itself)

Source: Guides/Wine/LoginFix. Built with dotnet build -c Release as shown above. This is the actual fix, installed once and left running.

inject-login.sh (manual fallback)

Source: Guides/Wine/LoginFix/inject-login.sh.

Use this only as a fallback, if the browser-to-Affinity handoff itself isn't completing (the OS-level affinity:// protocol handoff never reaching Wine at all, for example on a fresh prefix without a protocol handler registered yet). With LoginFix installed and a working protocol handler, sign-in completes on its own and you should not need this script.

It reads the callback URL with read -s, so the script never echoes the value to the terminal, writes it to disk, or leaves it in shell history.

How to run it manually:

  1. Sign in through the browser as normal, up to the point where it's about to open Affinity.

  2. Copy the affinity:// callback URL from the browser's address bar (or via "copy link" on the "Open Affinity?" confirmation page), instead of letting the OS open it automatically.

  3. Run the script, pointing it at the same Wine prefix and Wine binary your install uses:

    WINEPREFIX="$HOME/.affinity" WINE_BIN="wine" bash Guides/Wine/LoginFix/inject-login.sh

    Both environment variables are optional. They default to $HOME/.affinity and wine (whatever's on your PATH) if not set.

  4. Paste the URL when prompted, and press Enter. The script hands it to Wine with wine start <url>, the same mechanism the OS-level protocol handler would normally use.

Troubleshooting

Sign-in still doesn't complete after installing LoginFix

Confirm the plugin actually loaded: check apl/logs/apl.latest.log (set file_logging = true in apl/config/apl.toml first if the log file doesn't exist yet) for LoginFix entries. If it's not there, re-check the build/install steps above, especially that LoginFix.dll landed in apl/plugins/ alongside WineFix.dll.

inject-login.sh says "That doesn't look like an affinity:// URL"

You pasted something other than the callback URL, or the URL got truncated when copying. Re-copy it directly from the browser's address bar right before the handoff, and make sure it starts with affinity://.

Credits

LoginFix and this workflow were built and verified during this project's own troubleshooting sessions. See Related Projects: LoginFix for the full technical writeup and Related Projects: AffinityPluginLoader & WineFix for the plugin framework it depends on.

Clone this wiki locally