mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-20 07:26:19 +00:00
Add secure configuration bootstrap flow
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { FC, useEffect, useRef, useState } from 'react';
|
||||
import { GetConfigurationValue } from '../../api';
|
||||
import { NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../common';
|
||||
import { configFileUrl } from '../../secure-assets';
|
||||
|
||||
interface AdsenseConfig {
|
||||
slot: string;
|
||||
@@ -70,7 +71,7 @@ export const GoogleAdsView: FC<{}> = () => {
|
||||
try {
|
||||
const [ adsTxtRes, configRes ] = await Promise.all([
|
||||
fetch('/ads.txt', { cache: 'no-cache' }),
|
||||
fetch('/adsense.json', { cache: 'no-cache' })
|
||||
fetch(configFileUrl('adsense.json', true), { cache: 'no-cache' })
|
||||
]);
|
||||
|
||||
if (!adsTxtRes.ok) throw new Error(`ads.txt ${ adsTxtRes.status }`);
|
||||
@@ -156,7 +157,7 @@ export const GoogleAdsView: FC<{}> = () => {
|
||||
data-full-width-responsive={ (config.fullWidthResponsive ?? true) ? 'true' : 'false' }
|
||||
/> }
|
||||
{ !loadError && publisherId && config && !config.slot &&
|
||||
<div className="text-xs text-gray-500 text-center px-2">Ad slot not configured in adsense.json</div> }
|
||||
<div className="text-xs text-gray-500 text-center px-2">Ad slot not configured in configuration/adsense.json</div> }
|
||||
</div>
|
||||
</NitroCardContentView>
|
||||
</NitroCardView>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { GetConfiguration } from '@nitrots/nitro-renderer';
|
||||
import { FC, FormEvent, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { ClearRememberLogin, GetConfigurationValue, GetRememberLogin, StoreRememberLoginFromPayload } from '../../api';
|
||||
import { configFileUrl } from '../../secure-assets';
|
||||
import flagBr from '../../assets/images/flag_icon/flag_icon_br.png';
|
||||
import flagDe from '../../assets/images/flag_icon/flag_icon_de.png';
|
||||
import flagEn from '../../assets/images/flag_icon/flag_icon_en.png';
|
||||
@@ -1054,7 +1055,7 @@ const RegisterDialog: FC<RegisterDialogProps> = props =>
|
||||
{
|
||||
if(step !== 'avatar' || hotLooks.length) return;
|
||||
let cancelled = false;
|
||||
fetch('hotlooks.json', { credentials: 'omit' })
|
||||
fetch(configFileUrl('hotlooks.json', true), { credentials: 'omit' })
|
||||
.then(r => r.ok ? r.json() : null)
|
||||
.then((json: unknown) =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user