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:
parent
287f6bf91f
commit
16032399fa
|
@ -108,6 +108,7 @@ public class MAuthorizationCredential extends X_AD_AuthorizationCredential {
|
||||||
}
|
}
|
||||||
MPInstanceLog pilog = pinstance.addLog(null, 0, null, null, MAuthorizationAccount.Table_ID, 0);
|
MPInstanceLog pilog = pinstance.addLog(null, 0, null, null, MAuthorizationAccount.Table_ID, 0);
|
||||||
msg = processToken(Env.getCtx(), code, paramScope.getP_String(), pilog);
|
msg = processToken(Env.getCtx(), code, paramScope.getP_String(), pilog);
|
||||||
|
pilog.saveEx();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
msg = Msg.getMsg(getCtx(), "Error") + ex.getLocalizedMessage();
|
msg = Msg.getMsg(getCtx(), "Error") + ex.getLocalizedMessage();
|
||||||
|
@ -122,7 +123,7 @@ public class MAuthorizationCredential extends X_AD_AuthorizationCredential {
|
||||||
* @param ctx
|
* @param ctx
|
||||||
* @param code
|
* @param code
|
||||||
* @param paramScope
|
* @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
|
* @return String message indicating success
|
||||||
*/
|
*/
|
||||||
public String processToken(Properties ctx, String code, String paramScope, MPInstanceLog pilog) {
|
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();
|
String logmsg = Msg.parseTranslation(ctx, (newAccount ? "@Created@" : "@Updated@") + " @AD_AuthorizationAccount_ID@ for ") + account.getEMail();
|
||||||
pilog.setP_Msg(logmsg);
|
pilog.setP_Msg(logmsg);
|
||||||
pilog.setRecord_ID(account.getAD_AuthorizationAccount_ID());
|
pilog.setRecord_ID(account.getAD_AuthorizationAccount_ID());
|
||||||
pilog.saveEx();
|
|
||||||
}
|
}
|
||||||
account.syncOthers();
|
account.syncOthers();
|
||||||
if (newAccount)
|
if (newAccount)
|
||||||
|
|
Loading…
Reference in New Issue