IDEMPIERE-3101 implement OAuth2 for mail (gmail, outlook and other mail system) (#772)

Save the ad_pinstance_log record out of the method to independize it from the pinstance
This commit is contained in:
Carlos Ruiz 2021-07-07 19:25:08 +02:00 committed by GitHub
parent 287f6bf91f
commit 16032399fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -108,6 +108,7 @@ public class MAuthorizationCredential extends X_AD_AuthorizationCredential {
}
MPInstanceLog pilog = pinstance.addLog(null, 0, null, null, MAuthorizationAccount.Table_ID, 0);
msg = processToken(Env.getCtx(), code, paramScope.getP_String(), pilog);
pilog.saveEx();
} catch (Exception ex) {
ex.printStackTrace();
msg = Msg.getMsg(getCtx(), "Error") + ex.getLocalizedMessage();
@ -122,7 +123,7 @@ public class MAuthorizationCredential extends X_AD_AuthorizationCredential {
* @param ctx
* @param code
* @param paramScope
* @param pilog
* @param pilog MPInstanceLog to set the log message and record_ID, it is not saved, the caller must save it
* @return String message indicating success
*/
public String processToken(Properties ctx, String code, String paramScope, MPInstanceLog pilog) {
@ -198,7 +199,6 @@ public class MAuthorizationCredential extends X_AD_AuthorizationCredential {
String logmsg = Msg.parseTranslation(ctx, (newAccount ? "@Created@" : "@Updated@") + " @AD_AuthorizationAccount_ID@ for ") + account.getEMail();
pilog.setP_Msg(logmsg);
pilog.setRecord_ID(account.getAD_AuthorizationAccount_ID());
pilog.saveEx();
}
account.syncOthers();
if (newAccount)