Skip to content

Commit 4d1189e

Browse files
authored
Merge pull request #13 from ImLWChuen/feature/shared-signin-oauth
Feature/shared signin oauth
2 parents 23935c6 + 168ec2c commit 4d1189e

35 files changed

Lines changed: 3458 additions & 357 deletions

‎.env.example‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,16 @@ GOOGLE_CLIENT_ID=your-google-client-id.apps.googleusercontent.com
4343
GOOGLE_CLIENT_SECRET=your-google-client-secret
4444
GOOGLE_REDIRECT_URI=http://localhost:8000/api/v1/auth/oauth/google/callback
4545

46-
# Sign in with Apple (Return URL: http://localhost:8000/api/v1/auth/oauth/apple/callback)
46+
# Sign in with Apple (Return URL must be HTTPS; Apple rejects HTTP localhost)
4747
APPLE_CLIENT_ID=com.scholarpal.web
4848
APPLE_TEAM_ID=YOUR_APPLE_TEAM_ID
4949
APPLE_KEY_ID=YOUR_APPLE_KEY_ID
5050
APPLE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nYOUR_APPLE_P8_PRIVATE_KEY\n-----END PRIVATE KEY-----"
51-
APPLE_REDIRECT_URI=http://localhost:8000/api/v1/auth/oauth/apple/callback
51+
APPLE_REDIRECT_URI=https://<your-domain>/api/v1/auth/oauth/apple/callback
52+
53+
# --- Password Reset Email (Optional SMTP; logs reset link in dev when unset) ---
54+
SMTP_HOST=
55+
SMTP_PORT=587
56+
SMTP_USER=
57+
SMTP_PASSWORD=
58+
SMTP_FROM_EMAIL=[email protected]
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
"""add terms_accepted_version and terms_accepted_at to users
2+
3+
Revision ID: 0004_terms_acceptance
4+
Revises: 0003_oauth_accounts
5+
Create Date: 2026-12-02 20:20:00.000000
6+
"""
7+
8+
from __future__ import annotations
9+
10+
from collections.abc import Sequence
11+
12+
import sqlalchemy as sa
13+
14+
from alembic import op
15+
16+
# revision identifiers, used by Alembic.
17+
revision: str = "0004_terms_acceptance"
18+
down_revision: str | None = "0003_oauth_accounts"
19+
branch_labels: str | Sequence[str] | None = None
20+
depends_on: str | Sequence[str] | None = None
21+
22+
23+
def upgrade() -> None:
24+
op.add_column("users", sa.Column("terms_accepted_version", sa.String(length=32), nullable=True))
25+
op.add_column(
26+
"users",
27+
sa.Column("terms_accepted_at", sa.DateTime(timezone=True), nullable=True),
28+
)
29+
30+
31+
def downgrade() -> None:
32+
op.drop_column("users", "terms_accepted_at")
33+
op.drop_column("users", "terms_accepted_version")

0 commit comments

Comments
 (0)