yes I tried to use this combination, so the user would add a cb_token field and the API token would be generated. That seems a nice way to do it.
However the issue that I have is that the cb_api_token field seems to be changed at each display of the user profile so I cannot get the user to be retrieved in the autoaction.
Do you have an idea to keep the cb_api_token until the cb_token is changed by the user ? and also can I use an ajax display in profile edit when the cb_token is edited to display the cb_api_token updated ?
Code:
cb_token: text /validation one word only with letters and numbers
cb_api_token :
return ( new \Joomla\CMS\Encrypt\Aes( $_CB_framework->getCfg( 'secret' ) . ':[cb_token]]' ) )->encryptString( (string) \CBLib\Application\Application::MyUser()->getUserId() );
autoaction user code:
return (int) ( new \Joomla\CMS\Encrypt\Aes( $_CB_framework->getCfg( 'secret' ) . ':[cb_token]' ) )->decryptString( '[get_token]' );