Skip to content

Local development sign-in without a Google, GitHub or Apple OAuth app #13

Description

@jankarres

I wanted to fix something small in the app and needed a server to point it at, so I cloned this, copied .env.example, and ran pnpm run dev. That part is painless: central and the relay come up, SQLite creates itself, and the relay URL is derived in dev so the two find each other with no configuration.

Then the app said "Sign-in is not configured on this server yet", and that was as far as I got:

{
    "providers": [
        { "id": "google", "enabled": false },
        { "id": "github", "enabled": false },
        { "id": "apple", "enabled": false }
    ]
}

isProviderEnabled needs credentials from Google, GitHub or Apple, and everything is behind that gate: onboarding, pairing, the app WebSocket. So before I can watch a one-line change work I have to register an OAuth application with a third party, and with Apple I cannot do it against a local server at all, since it rejects http and localhost return URLs.

What would help is a fourth provider, say dev, switched on by putting an address in .env, that signs you in as that address without contacting anyone. If its authorization URL were the server's own callback, everything after it, the state, the exchange code, the cookies, the deep link, would be the paths you already have.

Keeping it out of production looks straightforward: central:start already hardcodes NODE_ENV=prod, so gating on that plus the address being set would put it out of reach of .env alone, and leaving it out of /auth/providers while disabled would keep that response unchanged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions