<?php
require __DIR__.'/common.php';require __DIR__.'/observe.php';if(is_file(__DIR__.'/private/auth.json'))throw new RuntimeException('Auth no replay');$ready=json_decode(file_get_contents(__DIR__.'/private/readiness.json'),true);if(!($ready['typed_exact_equal']??false))throw new RuntimeException('Readiness required');$before=$ready['source'];require __DIR__.'/app-init.php';NFGate::$lane=$lane;$token=(new \app\p\logic\Login())->userTokenSet($before['actor'][0]);if(NFGate::$journal!==[]||NFGate::$dml!==0)throw new RuntimeException('Token chain no business SQL');$save('auth.json',['token'=>$token,'actor'=>$before['actor'],'password_login_tested'=>false]);$save('auth-native.json',['native'=>NFGate::$journal,'included_files'=>$included(),'source_baseline'=>$before,'no_auth_SQL'=>true]);echo json_encode(['lane'=>$lane,'own_token_created'=>true,'SQL'=>0,'DML'=>0]),PHP_EOL;
