From d79e718e15fbfceb5a77ef91ec9540d35e01c058 Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Fri, 8 Dec 2023 18:45:36 -1000 Subject: [PATCH] feat: Add user registration via Web UI --- .vscode/settings.json | 3 + config/config.example.toml | 12 +++ pages/App.vue | 4 +- pages/Register.vue | 149 ++++++++++++++++++++++++++++ pages/RegistrationSuccess.vue | 14 +++ pages/components/LoginInput.vue | 5 +- pages/routes.ts | 4 + server/api/api/v1/accounts/index.ts | 13 ++- server/api/api/v1/instance/index.ts | 8 +- tsconfig.json | 2 +- types/entities/instance.ts | 1 + utils/config.ts | 11 ++ 12 files changed, 215 insertions(+), 11 deletions(-) create mode 100644 .vscode/settings.json create mode 100644 pages/Register.vue create mode 100644 pages/RegistrationSuccess.vue diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..4d360cbc --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "typescript.tsdk": "node_modules/typescript/lib" +} diff --git a/config/config.example.toml b/config/config.example.toml index 0d4ae856..e9b95555 100644 --- a/config/config.example.toml +++ b/config/config.example.toml @@ -24,6 +24,18 @@ port = 40007 api_key = "" enabled = true +[signups] +# URL of your Terms of Service +tos_url = "https://example.com/tos" +# Whether to enable registrations or not +registration = true +rules = [ + "Do not harass others", + "Be nice to people", + "Don't spam", + "Don't post illegal content", +] + # Delete this section if you don't want to use custom OAuth providers # This is an example configuration # The provider MUST support OpenID Connect with .well-known discovery diff --git a/pages/App.vue b/pages/App.vue index 6f8f7da5..3b798503 100644 --- a/pages/App.vue +++ b/pages/App.vue @@ -4,5 +4,7 @@ import '@unocss/reset/tailwind-compat.css' \ No newline at end of file diff --git a/pages/Register.vue b/pages/Register.vue new file mode 100644 index 00000000..6b2027b1 --- /dev/null +++ b/pages/Register.vue @@ -0,0 +1,149 @@ +