Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise((resolve, reject) => {
const unsubscribe = appBridge.subscribe(AuthCode.ActionType.RESPOND, (payload) => {
if (payload) {
resolve(payload);
} else {
reject("Failed to load");
}
unsubscribe();
});
appBridge.dispatch(AuthCode.request());
});
}