From 09597009cfea9c68afd7b15a15d7fa28f402e8c5 Mon Sep 17 00:00:00 2001 From: Andrew Kostka Date: Wed, 22 Jul 2026 11:26:50 +0000 Subject: [PATCH 1/2] Display policies from API during user registration --- src/backend/api.js | 4 + src/components/Cards/CreateAccount.vue | 112 +++++++++++++++++++------ 2 files changed, 91 insertions(+), 25 deletions(-) diff --git a/src/backend/api.js b/src/backend/api.js index c51845ed..8c5bc704 100644 --- a/src/backend/api.js +++ b/src/backend/api.js @@ -53,6 +53,10 @@ export const checkVerified = async () => { const { data } = await axios.get('/auth/login') return data.verified } +export const getCurrentPolicies = async () => { + const { data } = await axios.get('/v1/policies/current') + return data.items +} /* Wiki endpoints */ export const countWikis = async () => (await axios.get('/wiki/count')).data.data // TODO This doesn't seem to exist and not used? diff --git a/src/components/Cards/CreateAccount.vue b/src/components/Cards/CreateAccount.vue index 3e19ab3b..237d88d2 100644 --- a/src/components/Cards/CreateAccount.vue +++ b/src/components/Cards/CreateAccount.vue @@ -39,31 +39,55 @@ :disabled="inFlight" :error-messages="error['inputPasswordConfirmation']" /> - - @@ -87,7 +87,7 @@ -

This site is protected by reCAPTCHA. Wikibase Cloud Privacy Policy and Google @@ -143,8 +143,8 @@ export default { policy => ({ ...policy, name: policy.metadata.type.replaceAll('-', ' '), - url: `/${policy.metadata.type}/${policy.metadata.active_from}` - }) + url: `/${policy.metadata.type}/${policy.metadata.active_from}`, + }), ) } catch (err) { console.error(err) @@ -201,7 +201,7 @@ export default { const acceptedPolicies = Array.from( this.policies, - policy => policy.metadata.policy_id + policy => policy.metadata.policy_id, ) // Check for matching confirmed password