Updated configurations for deployment
This commit is contained in:
parent
81a1ac85af
commit
7b30f17065
9 changed files with 396 additions and 214 deletions
|
|
@ -11,6 +11,10 @@ try {
|
|||
$lang = faceai_request_value('lang', 'it');
|
||||
$returnUrl = faceai_request_value('returnUrl');
|
||||
|
||||
if (empty($config['feature_enabled'])) {
|
||||
faceai_redirect_with_error($returnUrl, 'La ricerca Face ID non e ancora disponibile.');
|
||||
}
|
||||
|
||||
if ($raceId === '' || $returnUrl === '') {
|
||||
faceai_render_message_page(
|
||||
'FaceAI handoff non disponibile',
|
||||
|
|
@ -25,25 +29,11 @@ try {
|
|||
|
||||
$identity = faceai_resolve_identity($config);
|
||||
if ($identity === null) {
|
||||
faceai_render_message_page(
|
||||
'FaceAI handoff in attesa del bridge legacy',
|
||||
'Questo endpoint PHP non puo leggere la sessione Java esistente. Per funzionare in produzione deve ricevere una identita firmata dal layer legacy o dal reverse proxy.',
|
||||
array(
|
||||
'Opzione consigliata: cookie firmato ' . $config['identity_cookie'] . ' con payload type=legacy-identity.',
|
||||
'Per test locale e possibile passare devUserId, devDisplayName, devEmail e devMembershipStatus se FACEAI_ALLOW_DEV_HANDOFF=1.',
|
||||
'Esempio locale: faceai_handoff.php?raceId=101&raceSlug=mezza-di-firenze&lang=it&returnUrl=http%3A%2F%2Flocalhost%2Fold&devUserId=1&devDisplayName=Mario%20Rossi&devEmail=mario%40example.test&devMembershipStatus=active'
|
||||
),
|
||||
501
|
||||
);
|
||||
faceai_redirect_with_error($returnUrl, 'Il servizio Face ID non e al momento disponibile. Riprova piu tardi.');
|
||||
}
|
||||
|
||||
if (($identity['membershipStatus'] ?? 'inactive') !== 'active') {
|
||||
faceai_render_message_page(
|
||||
'FaceAI non disponibile',
|
||||
'L utente corrente non risulta abilitato all uso di FaceAI in base allo stato di membership.',
|
||||
array('Stato attuale: ' . ($identity['membershipStatus'] ?? 'unknown')),
|
||||
403
|
||||
);
|
||||
faceai_redirect_with_error($returnUrl, 'Il tuo account non e abilitato all uso di Face ID.');
|
||||
}
|
||||
|
||||
$payload = array(
|
||||
|
|
@ -72,5 +62,5 @@ try {
|
|||
header('Location: ' . $targetUrl, true, 302);
|
||||
exit;
|
||||
} catch (Throwable $error) {
|
||||
faceai_render_message_page('Errore handoff FaceAI', $error->getMessage(), array(), 500);
|
||||
faceai_redirect_with_error(isset($returnUrl) ? $returnUrl : '', 'Il servizio Face ID non e al momento disponibile. Riprova piu tardi.');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue