Add Apple login provider #13

Open
opened 2026-04-19 07:23:30 +00:00 by forgejo-lila · 0 comments
Owner

Context

The app currently supports Google and GitHub login via Better Auth. Adding Apple expands the login options, especially for iOS users.

What to do

Add Apple as a social login provider in Better Auth.

Files to change

  • apps/api/src/lib/auth.ts — add apple to the socialProviders config in the betterAuth() call. Requires clientId and clientSecret from env vars.
  • .env.example — add APPLE_CLIENT_ID and APPLE_CLIENT_SECRET placeholders.
  • Production .env on VPS — add Apple credentials once obtained.
  • apps/web/src/routes/login.tsx — add a 'Continue with Apple' button calling signIn.social({ provider: 'apple', callbackURL: window.location.origin }).

Acceptance criteria

  • Users can sign in with their Apple account
  • A user row is created on first Apple login (same as Google/GitHub flow)
  • Login works in both dev (localhost) and production (lilastudy.com)
  • Apple callback URI is registered in Apple Developer Console for both environments

Prerequisites

  • Apple Developer account with Sign in with Apple configured
  • Service ID and key generated in Apple Developer Console

Notes

Better Auth docs: https://www.better-auth.com/docs/authentication/social-sign-in
Apple Sign in with Apple requires a paid Apple Developer account ($99/year). Evaluate whether the user base justifies this cost before starting.

## Context The app currently supports Google and GitHub login via Better Auth. Adding Apple expands the login options, especially for iOS users. ## What to do Add Apple as a social login provider in Better Auth. ## Files to change - `apps/api/src/lib/auth.ts` — add `apple` to the `socialProviders` config in the `betterAuth()` call. Requires `clientId` and `clientSecret` from env vars. - `.env.example` — add `APPLE_CLIENT_ID` and `APPLE_CLIENT_SECRET` placeholders. - Production `.env` on VPS — add Apple credentials once obtained. - `apps/web/src/routes/login.tsx` — add a 'Continue with Apple' button calling `signIn.social({ provider: 'apple', callbackURL: window.location.origin })`. ## Acceptance criteria - Users can sign in with their Apple account - A user row is created on first Apple login (same as Google/GitHub flow) - Login works in both dev (localhost) and production (lilastudy.com) - Apple callback URI is registered in Apple Developer Console for both environments ## Prerequisites - Apple Developer account with Sign in with Apple configured - Service ID and key generated in Apple Developer Console ## Notes Better Auth docs: https://www.better-auth.com/docs/authentication/social-sign-in Apple Sign in with Apple requires a paid Apple Developer account ($99/year). Evaluate whether the user base justifies this cost before starting.
forgejo-lila added the
feature
label 2026-04-19 07:23:30 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: forgejo-lila/lila#13
No description provided.