Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Error handling standard in api response
// https://tools.ietf.org/html/rfc6749#section-4.1.2
switch (error.message) {
case 'invalid_request':
case 'unauthorized_client':
case 'access_denied':
case 'unsupported_response_type':
case 'invalid_scope':
case 'interaction_required':
case 'login_required':
message = authMessages.accessDenied;
break;
case 'server_error':
case 'temporarily_unavailable':
default:
message = authMessages.internalError;
break;
}
this._alert.danger({
message,
payload: error,
});
}
}
import authMessages from 'ringcentral-integration/modules/Auth/authMessages';
export default {
[authMessages.internalError]: 'Se ha producido un fallo en el inicio de sesión debido a un error interno. Vuelva a intentarlo más tarde.',
[authMessages.accessDenied]: 'Acceso denegado. Póngase en contacto con el servicio de atención al cliente.',
[authMessages.sessionExpired]: 'La sesión ha expirado. Inicie sesión.',
};
// @key: @#@"[authMessages.internalError]"@#@ @source: @#@"Login failed due to internal errors. Please try again later."@#@
// @key: @#@"[authMessages.accessDenied]"@#@ @source: @#@"Access denied. Please contact support."@#@
// @key: @#@"[authMessages.sessionExpired]"@#@ @source: @#@"Session expired. Please sign in."@#@
import authMessages from 'ringcentral-integration/modules/Auth/authMessages';
export default {
[authMessages.internalError]: 'Falha de login devido a erros internos. Tente novamente mais tarde.',
[authMessages.accessDenied]: 'Acesso negado. Entre em contato com o Suporte.',
[authMessages.sessionExpired]: 'Sessão expirada. Conecte-se.',
};
// @key: @#@"[authMessages.internalError]"@#@ @source: @#@"Login failed due to internal errors. Please try again later."@#@
// @key: @#@"[authMessages.accessDenied]"@#@ @source: @#@"Access denied. Please contact support."@#@
// @key: @#@"[authMessages.sessionExpired]"@#@ @source: @#@"Session expired. Please sign in."@#@
import authMessages from 'ringcentral-integration/modules/Auth/authMessages';
export default {
[authMessages.internalError]: "因為內部錯誤導致登入失敗。請稍後再試一次。",
[authMessages.accessDenied]: "存取遭拒。請聯絡支援部門。",
[authMessages.sessionExpired]: "執行階段已過期。請登入。"
};
// @key: @#@"[authMessages.internalError]"@#@ @source: @#@"Login failed due to internal errors. Please try again later."@#@
// @key: @#@"[authMessages.accessDenied]"@#@ @source: @#@"Access denied. Please contact support."@#@
// @key: @#@"[authMessages.sessionExpired]"@#@ @source: @#@"Session expired. Please sign in."@#@
import authMessages from 'ringcentral-integration/modules/Auth/authMessages';
export default {
[authMessages.internalError]: "Login failed due to internal errors. Please try again later.",
[authMessages.accessDenied]: "Access denied. Please contact support.",
[authMessages.sessionExpired]: "Session expired. Please sign in."
};
// @key: @#@"[authMessages.internalError]"@#@ @source: @#@"Login failed due to internal errors. Please try again later."@#@
// @key: @#@"[authMessages.accessDenied]"@#@ @source: @#@"Access denied. Please contact support."@#@
// @key: @#@"[authMessages.sessionExpired]"@#@ @source: @#@"Session expired. Please sign in."@#@
import authMessages from 'ringcentral-integration/modules/Auth/authMessages';
export default {
[authMessages.internalError]: "Falha de login devido a erros internos. Tente novamente mais tarde.",
[authMessages.accessDenied]: "Acesso negado. Entre em contato com o Suporte.",
[authMessages.sessionExpired]: "Sessão expirada. Conecte-se."
};
// @key: @#@"[authMessages.internalError]"@#@ @source: @#@"Login failed due to internal errors. Please try again later."@#@
// @key: @#@"[authMessages.accessDenied]"@#@ @source: @#@"Access denied. Please contact support."@#@
// @key: @#@"[authMessages.sessionExpired]"@#@ @source: @#@"Session expired. Please sign in."@#@
import authMessages from 'ringcentral-integration/modules/Auth/authMessages';
export default {
[authMessages.internalError]: "Login failed due to internal errors. Please try again later.",
[authMessages.accessDenied]: "Access denied. Please contact support.",
[authMessages.sessionExpired]: "Session expired. Please sign in."
};
// @key: @#@"[authMessages.internalError]"@#@ @source: @#@"Login failed due to internal errors. Please try again later."@#@
// @key: @#@"[authMessages.accessDenied]"@#@ @source: @#@"Access denied. Please contact support."@#@
// @key: @#@"[authMessages.sessionExpired]"@#@ @source: @#@"Session expired. Please sign in."@#@
import authMessages from 'ringcentral-integration/modules/Auth/authMessages';
export default {
[authMessages.internalError]: 'Échec de la connexion en raison d\'erreurs internes. Veuillez réessayer plus tard.',
[authMessages.accessDenied]: 'Accès refusé. Veuillez communiquer avec le service d\'assistance.',
[authMessages.sessionExpired]: 'La session a expiré. Veuillez vous connecter.',
};
// @key: @#@"[authMessages.internalError]"@#@ @source: @#@"Login failed due to internal errors. Please try again later."@#@
// @key: @#@"[authMessages.accessDenied]"@#@ @source: @#@"Access denied. Please contact support."@#@
// @key: @#@"[authMessages.sessionExpired]"@#@ @source: @#@"Session expired. Please sign in."@#@
message = authMessages.accessDenied;
break;
case 'login_required':
case 'interaction_required':
case 'access_denied': {
if (this.authMode === 'sso' && this._ssoFrame) {
this._clearSSOIframe();
} else {
message = authMessages.accessDenied;
}
break;
}
case 'server_error':
case 'temporarily_unavailable':
default:
message = authMessages.internalError;
break;
}
if (message) {
this._alert.danger({
message,
payload: error,
});
}
}
}
}
AuthAlert.handleMessage = ({ message }) =>
message === authMessages.accessDenied ||
message === authMessages.internalError ||
message === authMessages.sessionExpired;