diff --git a/.env.development b/.env.development new file mode 100644 index 0000000..1d0b57f --- /dev/null +++ b/.env.development @@ -0,0 +1 @@ +VITE_API_BASE_URL = http://localhost:4010 \ No newline at end of file diff --git a/env.d.ts b/env.d.ts index 11f02fe..84087a9 100644 --- a/env.d.ts +++ b/env.d.ts @@ -1 +1,9 @@ /// + +interface ImportMetaEnv { + readonly VITE_API_BASE_URL: string; +} + +interface ImportMeta { + readonly env: ImportMetaEnv; +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index cd291e0..9765218 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "@types/eslint__js": "^8.42.3", "eslint-config-prettier": "^9.1.0", + "jwt-decode": "^4.0.0", "validator": "^13.12.0", "vue": "^3.5.6", "vue-router": "^4.3.3" @@ -18,6 +19,7 @@ "@eslint/js": "^9.11.0", "@rushstack/eslint-patch": "^1.8.0", "@tsconfig/node20": "^20.1.4", + "@types/jwt-decode": "^2.2.1", "@types/node": "^20.14.5", "@types/validator": "^13.12.2", "@vitejs/plugin-vue": "^5.1.3", @@ -1019,6 +1021,13 @@ "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "license": "MIT" }, + "node_modules/@types/jwt-decode": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@types/jwt-decode/-/jwt-decode-2.2.1.tgz", + "integrity": "sha512-aWw2YTtAdT7CskFyxEX2K21/zSDStuf/ikI3yBqmwpwJF0pS+/IX5DWv+1UFffZIbruP6cnT9/LAJV1gFwAT1A==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/node": { "version": "20.14.9", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.9.tgz", @@ -2713,6 +2722,15 @@ "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==" }, + "node_modules/jwt-decode": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-4.0.0.tgz", + "integrity": "sha512-+KJGIyHgkGuIq3IEBNftfhW/LfWhXUIY6OmyVWjliu5KH1y0fw7VQ8YndE2O4qZdMSd9SqbnC8GOcZEy0Om7sA==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", @@ -2865,15 +2883,16 @@ } }, "node_modules/nanoid": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", - "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", "funding": [ { "type": "github", "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "bin": { "nanoid": "bin/nanoid.cjs" }, diff --git a/package.json b/package.json index f6812ec..bba0f6d 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "dependencies": { "@types/eslint__js": "^8.42.3", "eslint-config-prettier": "^9.1.0", + "jwt-decode": "^4.0.0", "validator": "^13.12.0", "vue": "^3.5.6", "vue-router": "^4.3.3" @@ -25,6 +26,7 @@ "@eslint/js": "^9.11.0", "@rushstack/eslint-patch": "^1.8.0", "@tsconfig/node20": "^20.1.4", + "@types/jwt-decode": "^2.2.1", "@types/node": "^20.14.5", "@types/validator": "^13.12.2", "@vitejs/plugin-vue": "^5.1.3", diff --git a/src/assets/main.css b/src/assets/main.css index e349ba2..5634a6e 100644 --- a/src/assets/main.css +++ b/src/assets/main.css @@ -64,7 +64,16 @@ line-height: 1rem; } -.fontstyle-ui-caption { +.fontstyle-ui-caption-link { + @apply font-primary; + font-size: 0.75rem; + font-style: normal; + font-weight: 400; + line-height: 1rem; + text-decoration: underline; +} + +.fontstyle-ui-caption-strong { @apply font-primary; font-size: 0.75rem; font-style: normal; diff --git a/src/components/Controls/OAuthButton.vue b/src/components/Controls/OAuthButton.vue new file mode 100644 index 0000000..a16c0bd --- /dev/null +++ b/src/components/Controls/OAuthButton.vue @@ -0,0 +1,74 @@ + + + + + diff --git a/src/utils/validator.ts b/src/utils/validator.ts new file mode 100644 index 0000000..ca2008a --- /dev/null +++ b/src/utils/validator.ts @@ -0,0 +1,11 @@ +export const usernameValidator = (username: string): boolean => { + return /^[A-Za-z0-9_]{5,10}$/.test(username) +} + +export const passwordValidator = (password: string): boolean => { + const hasLetter = /[A-Za-z]/.test(password); + const hasNumber = /[0-9]/.test(password); + const hasSpecialChar = /[!@#$%^&*()_+\-={}[\]:;"'<>,.?/]/.test(password); + const isValid = /^[A-Za-z0-9!@#$%^&*()_+\-={}[\]:;"'<>,.?/]{10,64}$/.test(password); + return hasLetter && hasNumber && hasSpecialChar && isValid; +} \ No newline at end of file diff --git a/src/views/SignupAfterMailView.vue b/src/views/SignupAfterMailView.vue index d091e29..3d9df78 100644 --- a/src/views/SignupAfterMailView.vue +++ b/src/views/SignupAfterMailView.vue @@ -1,8 +1,37 @@ - + diff --git a/src/views/SignupRegisterView.vue b/src/views/SignupRegisterView.vue index 3387b0c..24e830a 100644 --- a/src/views/SignupRegisterView.vue +++ b/src/views/SignupRegisterView.vue @@ -1,8 +1,166 @@ - + diff --git a/src/views/SignupView.vue b/src/views/SignupView.vue index aeaf190..4e45fe9 100644 --- a/src/views/SignupView.vue +++ b/src/views/SignupView.vue @@ -1,8 +1,59 @@ - + diff --git a/vite.config.ts b/vite.config.ts index 5c45e1d..030a165 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,6 +1,7 @@ import { fileURLToPath, URL } from 'node:url' -import { defineConfig } from 'vite' +import { defineConfig, loadEnv } from 'vite'; + import vue from '@vitejs/plugin-vue' // https://vitejs.dev/config/