upd: apply suggestions

This commit is contained in:
Marie 2024-09-14 14:11:12 +02:00
parent 8b4c6e00b4
commit 5cd11cacdc
No known key found for this signature in database
GPG Key ID: 7ADF6C9CD9A28555
9 changed files with 37 additions and 29 deletions

View File

@ -2820,10 +2820,10 @@ _contextMenu:
native: "Native"
_stripeAgeCheck:
startText: We require you to confirm your identity, Please press the start button to begin the process
beginProcess: Press the open Stripe in new tab button to begin Identification through Stripe
endProcess: If you have completed the Stripe verification process, wait a few seconds and then click Confirm completion.
startText: "We require you to confirm your identity, Please press the start button to begin the process"
beginProcess: "Press the open Stripe in new tab button to begin Identification through Stripe"
endProcess: "If you have completed the Stripe verification process, wait a few seconds and then click Confirm completion."
_buttons:
start: Start Verification
openInNewTab: Open Stripe in new tab
confirmFinish: Confirm completion
start: "Start Verification"
openInNewTab: "Open Stripe in new tab"
confirmFinish: "Confirm completion"

View File

@ -2895,10 +2895,10 @@ _contextMenu:
native: "ブラウザのUI"
_stripeAgeCheck:
startText: ご本人様確認をさせていただきますので、スタートボタンを押して手続きを開始してください。
beginProcess: 新しいタブでStripeを開くボタンを押すと、Stripeでの本人確認が開始されます。
endProcess: Stripeでの本人確認手続きが完了した場合は、数秒待ってから完了をクリックしてください。
startText: "ご本人様確認をさせていただきますので、スタートボタンを押して手続きを開始してください。"
beginProcess: "新しいタブでStripeを開くボタンを押すと、Stripeでの本人確認が開始されます。"
endProcess: "Stripeでの本人確認手続きが完了した場合は、数秒待ってから完了をクリックしてください。"
_buttons:
start: 検証を開始する
openInNewTab: 新しいタブでStripeを開く
confirmFinish: 完成を確認する
start: "検証を開始する"
openInNewTab: "新しいタブでStripeを開く"
confirmFinish: "完成を確認する"

View File

@ -278,7 +278,7 @@ export const packedMetaDetailedOnlySchema = {
properties: {
features: {
type: 'object',
optional: false, nullable: false,
optional: true, nullable: false,
properties: {
registration: {
type: 'boolean',

View File

@ -131,7 +131,9 @@ export class StripeHookServerService {
this.logger.succ(`${user.username} has failed ID Verification via Session ${verificationSession.id}`);
await this.usersRepository.update(user.id, { idCheckRequired: false });
// If general instance then unset idCheckRequired as to prevent locking the user out forever admins/mods can see the mod note in case of the failure
if (!this.config.stripeAgeCheck.required) await this.usersRepository.update(user.id, { idCheckRequired: false });
await this.userProfilesRepository.update(user.id, { moderationNote: 'ADM/IDFAIL: Possibly underage' });

View File

@ -21,7 +21,7 @@ export const version = _VERSION_;
export const instanceName = siteName === 'Sharkey' || siteName == null ? host : siteName;
export const ui = miLocalStorage.getItem('ui');
export const debug = miLocalStorage.getItem('debug') === 'true';
export const idRequired: any = document.querySelector<HTMLMetaElement>('meta[property="idRequired"]')?.content === 'true' ? true : false;
export const idRequired = document.querySelector<HTMLMetaElement>('meta[property="idRequired"]')?.content === 'true' ? true : false;
export function updateLocale(newLocale): void {
locale = newLocale;

View File

@ -187,14 +187,14 @@ export class Router extends EventEmitter<RouterEvent> implements IRouter {
public currentRoute: ShallowRef<RouteDef>;
private currentPath: string;
private isLoggedIn: boolean;
private isNotIdConfirmed: boolean;
private isIdConfirmed: boolean;
private notFoundPageComponent: Component;
private currentKey = Date.now().toString();
private redirectCount = 0;
public navHook: ((path: string, flag?: any) => boolean) | null = null;
constructor(routes: Router['routes'], currentPath: Router['currentPath'], isLoggedIn: boolean, isNotIdConfirmed: boolean, notFoundPageComponent: Component) {
constructor(routes: Router['routes'], currentPath: Router['currentPath'], isLoggedIn: boolean, isIdConfirmed: boolean, notFoundPageComponent: Component) {
super();
this.routes = routes;
@ -203,7 +203,7 @@ export class Router extends EventEmitter<RouterEvent> implements IRouter {
this.currentRoute = shallowRef(this.current.route);
this.currentPath = currentPath;
this.isLoggedIn = isLoggedIn;
this.isNotIdConfirmed = isNotIdConfirmed;
this.isIdConfirmed = isIdConfirmed;
this.notFoundPageComponent = notFoundPageComponent;
}
@ -369,7 +369,7 @@ export class Router extends EventEmitter<RouterEvent> implements IRouter {
res.props.set('showLoginPopup', true);
}
if (res.route.idRequired && this.isNotIdConfirmed) {
if (res.route.idRequired && !this.isIdConfirmed) {
res.route.component = this.notFoundPageComponent;
res.props.set('showIdConfirm', true);
}

View File

@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template>
<div v-if="meta" class="rsqzvsbo">
<MkFeaturedPhotos class="bg"/>
<XTimeline v-if="!meta.features!.idRequired" class="tl"/>
<XTimeline v-if="!meta.features?.idRequired" class="tl"/>
<div class="shape1"></div>
<div class="shape2"></div>
<div class="logo-wrapper">

View File

@ -18,6 +18,10 @@ const page = (loader: AsyncComponentLoader<any>) => defineAsyncComponent({
errorComponent: MkError,
});
const userNeedsChecking = $i && $i.idCheckRequired ? true : false;
const noUserButCheckRequired = !$i && idRequired ? true : false;
const userNotVerifiedYet = $i && !$i.idVerified && idRequired ? true : false;
const routes: RouteDef[] = [{
path: '/@:initUser/pages/:initPageName/view-source',
component: page(() => import('@/pages/page-editor/page-editor.vue')),
@ -53,7 +57,7 @@ const routes: RouteDef[] = [{
path: '/settings',
component: page(() => import('@/pages/settings/index.vue')),
loginRequired: true,
idRequired: $i && $i.idCheckRequired ? true : false,
idRequired: userNeedsChecking,
children: [{
path: '/profile',
name: 'profile',
@ -337,11 +341,11 @@ const routes: RouteDef[] = [{
}, {
path: '/channels/:channelId',
component: page(() => import('@/pages/channel.vue')),
idRequired: $i && $i.idCheckRequired || !$i && idRequired ? true : false,
idRequired: userNeedsChecking || noUserButCheckRequired,
}, {
path: '/channels',
component: page(() => import('@/pages/channels.vue')),
idRequired: $i && $i.idCheckRequired || !$i && idRequired ? true : false,
idRequired: userNeedsChecking || noUserButCheckRequired,
}, {
path: '/custom-emojis-manager',
component: page(() => import('@/pages/custom-emojis-manager.vue')),
@ -563,12 +567,12 @@ const routes: RouteDef[] = [{
path: '/timeline/list/:listId',
component: page(() => import('@/pages/user-list-timeline.vue')),
loginRequired: true,
idRequired: $i && $i.idCheckRequired || !$i && idRequired ? true : false,
idRequired: userNeedsChecking || noUserButCheckRequired,
}, {
path: '/timeline/antenna/:antennaId',
component: page(() => import('@/pages/antenna-timeline.vue')),
loginRequired: true,
idRequired: $i && $i.idCheckRequired || !$i && idRequired ? true : false,
idRequired: userNeedsChecking || !noUserButCheckRequired,
}, {
path: '/clicker',
component: page(() => import('@/pages/clicker.vue')),
@ -592,13 +596,13 @@ const routes: RouteDef[] = [{
}, {
path: '/timeline',
component: page(() => import('@/pages/timeline.vue')),
idRequired: $i && $i.idCheckRequired || !$i && idRequired ? true : false,
idRequired: userNeedsChecking || noUserButCheckRequired,
}, {
name: 'index',
path: '/',
component: $i ? page(() => import('@/pages/timeline.vue')) : page(() => import('@/pages/welcome.vue')),
globalCacheKey: 'index',
idRequired: $i && $i.idCheckRequired || $i && !$i.idVerified && idRequired ? true : false,
idRequired: userNeedsChecking || userNotVerifiedYet,
}, {
// テスト用リダイレクト設定。ログイン中ユーザのプロフィールにリダイレクトする
path: '/redirect-test',
@ -609,8 +613,10 @@ const routes: RouteDef[] = [{
component: page(() => import('@/pages/not-found.vue')),
}];
const isIdConfirmedCheck = userNeedsChecking ? false : true || noUserButCheckRequired ? false : true || userNotVerifiedYet ? false : true;
function createRouterImpl(path: string): IRouter {
return new Router(routes, path, !!$i, $i && $i.idCheckRequired || !$i && idRequired || $i && !$i.idVerified && idRequired, page(() => import('@/pages/not-found.vue')));
return new Router(routes, path, !!$i, isIdConfirmedCheck, page(() => import('@/pages/not-found.vue')));
}
/**

View File

@ -5118,7 +5118,7 @@ export type components = {
noteSearchableScope: 'local' | 'global';
};
MetaDetailedOnly: {
features: {
features?: {
registration: boolean;
emailRequiredForSignup: boolean;
localTimeline: boolean;