Check ip range for public/private view.

This commit is contained in:
2023-09-20 11:24:10 +02:00
parent e58713b7ac
commit c05de10192
5 changed files with 50 additions and 8 deletions

View File

@@ -1,4 +1,4 @@
import { clientConfig, serverConfig } from '$lib/server/config';
import { clientAddressIsPrivate, clientConfig, serverConfig } from '$lib/server/config';
import type { PageServerLoad } from './$types';
import { getServiceHandler } from '$lib/services/services';
@@ -22,5 +22,9 @@ export const load: PageServerLoad = ({ fetch, getClientAddress }) => {
}
}
return { config, serviceData, location: getClientAddress() };
return {
config,
serviceData,
privateAccess: clientAddressIsPrivate(getClientAddress(), privateConfig)
};
};