Skip to content

Auth and repos ​

Sign up (invite-only) ​

Sign-up needs a one-time invite code: POST /invites mints one for any signed-in user, and operators can seed codes with AMN3SIA_INVITE_CODES. Send it as invite_code to POST /auth/signup with the user_id:

bash
curl -X POST http://localhost:8080/auth/signup \
  -H 'Content-Type: application/json' \
  -d '{"user_id": "alice", "invite_code": "inv_..."}'

The response carries an access_token plus a one-time forge_password: the Forgejo git credential for that user. amn3sia never stores the password — show it once and keep it somewhere safe. Reused, unknown or malformed codes get 403 invalid_invite.

Passkeys and login ​

Register a passkey (POST /webauthn/register/...), then sign in (POST /webauthn/login/...). Login finish issues an access token; in a browser it also sets the amn3sia_session cookie, and /oidc/authorize redirects back to the web app with a PKCE code.

Repos ​

List what you may see, then create:

bash
curl http://localhost:8080/repos -H "Authorization: Bearer TOKEN"
curl -X POST http://localhost:8080/repos \
  -H "Authorization: Bearer TOKEN" -H 'Content-Type: application/json' \
  -d '{"org": "alice", "name": "demo", "kind": "vault"}'

kind is vault or standard and is fixed at creation. Personal repos (org = your user id) live under your Forgejo user; org repos need membership and grant the whole org push rights on creation.

Push with the one-time password from signup:

bash
git push http://alice:PASSWORD@localhost:3000/alice/demo.git main

Lost the password? Mint a fresh one (the old one keeps working until you change or delete it in Forgejo):

bash
curl -X POST http://localhost:8080/git-credentials/rotate \
  -H "Authorization: Bearer TOKEN"