vocascan / vocascan-server

Server for Vocascan
https://vocascan.com
Apache License 2.0
26 stars 5 forks source link

Feature: invite codes #56

Closed noctera closed 2 years ago

noctera commented 3 years ago
Status Type Env Vars Change
✅ Hold Feature Yes

Description

With this PR you will have the ability to lock the server registration and only let people register when they have a valid invite code.

Just set the REGISTRATION_LOCKED=true in the env vars

Routes with responses comming soon

`POST /api/inviteCode?maxUses=100&expirationDate=2021-09-02T14:52:25.694Z`
Response ```json { "id": "3ff7160a-36d8-4794-aea6-6820e6ff57d4", "code": "daOdjto3", "uses": 0, "maxUses": 100, "expirationDate": 2021-09-02T14:52:25.694Z } ```
`GET /api/inviteCode`
Response ```json [ { "id": "a2ab34cf-87a3-4301-8802-a907849ec330", "code": "rAVAvCkV", "uses": 1, "maxUses": 100, "expirationDate": "2021-09-02T14:52:25.694Z" }, ] ```
`DELETE/api/inviteCode/:inviteCode`
Response ``status code: 204``

Motivation and Context

Screenshots / GIFs (if appropriate):

Checklist

Resolves