Notechondria

Version: 0.1.8 Build Date: 2026-04-07T18:00

What's Changed

Google and GitHub OAuth sign-in

  • Added SocialAccount model linking Django users to external OAuth providers (Google, GitHub). Stores provider, provider_uid, email, extra_data with unique constraint on (provider, provider_uid).
  • Added GoogleOAuthApiView — exchanges Google authorization code or ID token for an app auth token. Verifies via Google tokeninfo endpoint, validates audience, creates or links user.
  • Added GitHubOAuthApiView — exchanges GitHub authorization code for access token, fetches user profile and primary verified email, creates or links user.
  • Added OAuthConfigApiView — public endpoint returning OAuth client IDs and redirect URIs so frontends can construct authorization URLs without hardcoding credentials.
  • Added SocialAccountListApiView and SocialAccountUnlinkApiView for authenticated users to manage linked social accounts.
  • OAuth user creation handles three cases: (1) existing social link updates and returns, (2) existing email user auto-links the social account, (3) new user validates invitation code if required and creates account with unusable password.
  • Both Google and GitHub views accept optional redirect_uri from frontend, falling back to configured settings, so multiple frontend apps can share the same OAuth credentials.
  • Frontend NotechondriaClient extended with loginWithGoogle, loginWithGithub, and getOAuthConfig methods in all three apps (editor, planner, portal).
  • Added Google and GitHub buttons to _AuthHub in all three apps, gated by onGoogleLogin/onGithubLogin callbacks (hidden when null).
  • Added _launchOAuth(provider) and _handleOAuthCallback() to all three app shells. On button press, fetches OAuth config, constructs auth URL, saves redirect_uri to SharedPreferences, and redirects browser. On page load, detects ?code=&state= query parameters and auto-completes login.
  • Added url_strategy.dart / url_strategy_web.dart to planner and portal apps (editor already had them) with browserRedirect for same-tab navigation.

Jenkins deployment fixes

  • Fixed .env.deploy sourcing error (exit code 127): DJANGO_ALLOWED_HOSTS_COMPOSE value with spaces was interpreted as a command. Wrapped in single quotes in prepare_env.sh heredoc output.
  • Fixed Docker build context errors (exit code 17): root docker-compose.yml had context: ./backend but Dockerfile references files relative to repo root. Changed to context: . and dockerfile: backend/Dockerfile.

Jenkins documentation

  • Added first-time Jenkins setup guide (plugin installation, Docker access, pipeline job creation, environment injection, first build troubleshooting).
  • Added OAuth credential variables to Jenkins Properties Content example.

Environment files

  • Added GITHUB_AUTHORIZED_REDIRECT_URI, GOOGLE_OAUTH_CLIENT_ID, GOOGLE_OAUTH_CLIENT_SECRET, GOOGLE_AUTHORIZED_REDIRECT_URI placeholders to sample.env and sample.render.env.
  • Added OAuth environment variables to backend/docker-compose.yml app service.

Files Changed

  • backend/creators/models.py -- Added SocialProviderChoices enum and SocialAccount model
  • backend/creators/migrations/0026_socialaccount.py -- Migration for SocialAccount table
  • backend/creators/api.py -- Added OAuthConfigApiView, GoogleOAuthApiView, GitHubOAuthApiView, SocialAccountListApiView, SocialAccountUnlinkApiView, helper functions
  • backend/notechondria/api_urls.py -- Added routes for oauth-config, google, github, social-accounts
  • backend/notechondria/settings.py -- Added OAuth settings (GOOGLE_OAUTH_, GITHUB_APP_CLIENT_, redirect URIs)
  • backend/docker-compose.yml -- Added OAuth env vars to app service
  • deployment/jenkins/scripts/prepare_env.sh -- Quoted DJANGO_ALLOWED_HOSTS_COMPOSE, added OAuth env vars
  • docker-compose.yml -- Fixed build context from ./backend to .
  • frontend/editor_app/lib/core/client.dart -- Added loginWithGoogle, loginWithGithub, getOAuthConfig
  • frontend/editor_app/lib/core/url_strategy.dart -- Added browserRedirect stub
  • frontend/editor_app/lib/core/url_strategy_web.dart -- Added browserRedirect implementation
  • frontend/editor_app/lib/components/auth_dialogs.dart -- Added onGoogleLogin/onGithubLogin to _AuthHub with Google/GitHub buttons
  • frontend/editor_app/lib/modules/settings.dart -- Wired OAuth callbacks through _SettingsPage
  • frontend/editor_app/lib/app_shell.dart -- Added _launchOAuth, _handleOAuthCallback, wired to settings
  • frontend/planner_app/lib/core/client.dart -- Added loginWithGoogle, loginWithGithub, getOAuthConfig
  • frontend/planner_app/lib/core/url_strategy.dart -- New: browserRedirect stub
  • frontend/planner_app/lib/core/url_strategy_web.dart -- New: browserRedirect web implementation
  • frontend/planner_app/lib/main.dart -- Added url_strategy conditional import
  • frontend/planner_app/lib/modules/settings.dart -- Added OAuth callbacks to _AuthHub and _SettingsPage
  • frontend/planner_app/lib/app_shell.dart -- Added _launchOAuth, _handleOAuthCallback, wired to settings
  • frontend/portal_app/lib/core/client.dart -- Added loginWithGoogle, loginWithGithub, getOAuthConfig
  • frontend/portal_app/lib/core/url_strategy.dart -- New: browserRedirect stub
  • frontend/portal_app/lib/core/url_strategy_web.dart -- New: browserRedirect web implementation
  • frontend/portal_app/lib/main.dart -- Added url_strategy conditional import
  • frontend/portal_app/lib/modules/settings.dart -- Added OAuth callbacks to _AuthHub and _SettingsPage
  • frontend/portal_app/lib/app_shell.dart -- Added _launchOAuth, _handleOAuthCallback, wired to settings
  • sample.env -- Added OAuth credential placeholders
  • sample.render.env -- Added OAuth credential placeholders
  • docs/deployment/deploy.md -- Added Jenkins first-time setup guide, OAuth vars to Properties Content
  • docs/TASKS.md -- Marked OAuth and social account tasks as complete
  • docs/versions/0.1.8.md -- This version document