Now with the ability to look up user email and send user auth key.

This commit is contained in:
Scott Idem
2025-04-08 15:51:05 -04:00
parent 73eee7b8ff
commit 0d8b47af10
5 changed files with 283 additions and 13 deletions

View File

@@ -125,11 +125,14 @@ export async function load({ fetch, params, parent, route, url }) { // params, r
submenu: {},
};
// let parent_data = await parent();
// console.log(`root +layout.ts parent_data:`, parent_data);
// First do a site_domain look up to check if it is valid and get the account_id.
// ae_loc.url_host = data.url.host; // Use this to look up? sub.example.com:123
// ae_loc.fqdn = url.host; // Use this to look up? sub.example.com:123
// ae_loc.url_hostname = data.url.hostname; // sub.example.com
// ae_loc.url_origin = data.url.origin; // Use this to look up? https://sub.example.com:123
// ae_loc.url_hostname = parent_data.url.hostname; // sub.example.com
// ae_loc.url_origin = parent_data.url.origin; // Use this to look up? https://sub.example.com:123
// ae_loc.site_domain = data.url.origin;
// console.log(`ae_loc = `, ae_loc);
@@ -200,6 +203,9 @@ export async function load({ fetch, params, parent, route, url }) { // params, r
ae_loc_init['site_access_key'] = json_data.access_key; // This is the general site access key
ae_loc_init['site_domain_access_key'] = json_data.site_domain_access_key; // This is specific to a (sub)domain.
ae_loc_init['base_url'] = url.origin;
ae_loc_init['hostname'] = url.hostname
if (!ae_loc_init['site_access_key'] && !ae_loc_init['site_domain_access_key']) {
ae_loc_init['key_checked'] = true; // Se to true to allow access without a key.
ae_loc_init['allow_access'] = true; // No access key is required here.