fix: Integration and auth problems wrt slack and twitter
This commit is contained in:
@@ -2,19 +2,21 @@ import type { IApp } from '@automatisch/types';
|
||||
import appConfig from '../config/app';
|
||||
|
||||
const appInfoConverter = (rawAppData: IApp) => {
|
||||
const stringifiedRawAppData = JSON.stringify(rawAppData);
|
||||
|
||||
let computedRawData = stringifiedRawAppData.replace(
|
||||
rawAppData.iconUrl = rawAppData.iconUrl.replace(
|
||||
'{BASE_URL}',
|
||||
appConfig.baseUrl
|
||||
);
|
||||
computedRawData = computedRawData.replace(
|
||||
'{WEB_APP_URL}',
|
||||
appConfig.webAppUrl
|
||||
);
|
||||
|
||||
const computedJSONData: IApp = JSON.parse(computedRawData);
|
||||
return computedJSONData;
|
||||
if (rawAppData.auth?.fields) {
|
||||
rawAppData.auth.fields = rawAppData.auth.fields.map((field) => {
|
||||
return {
|
||||
...field,
|
||||
value: field.value?.replace('{WEB_APP_URL}', appConfig.webAppUrl),
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
return rawAppData;
|
||||
};
|
||||
|
||||
export default appInfoConverter;
|
||||
|
Reference in New Issue
Block a user