mirror of
https://github.com/formbricks/formbricks.git
synced 2025-12-23 22:50:35 -06:00
fix: fixes formbricks.logout (#4672)
This commit is contained in:
@@ -54,6 +54,13 @@ export const fetchPersonState = async (
|
||||
responseMessage: jsonRes.message,
|
||||
});
|
||||
|
||||
if (error.error.code === "forbidden") {
|
||||
logger.error(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- we want to log the error message if it exists
|
||||
error.error.responseMessage ?? "User identification is not available for this environment"
|
||||
);
|
||||
}
|
||||
|
||||
throw new Error(error.error.message);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,9 +9,10 @@ const config = Config.getInstance();
|
||||
const logger = Logger.getInstance();
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/require-await -- There are no promises but our proxy makes the functions async
|
||||
export const logoutPerson = async (): Promise<void> => {
|
||||
export const logoutPerson = async (): Promise<Result<void, NetworkError>> => {
|
||||
deinitalize();
|
||||
config.resetConfig();
|
||||
return okVoid();
|
||||
};
|
||||
|
||||
export const resetPerson = async (): Promise<Result<void, NetworkError>> => {
|
||||
|
||||
@@ -57,8 +57,8 @@ export function SurveyModal({
|
||||
onFinished?.();
|
||||
setTimeout(
|
||||
() => {
|
||||
const firstEnabledEnding = survey.endings[0];
|
||||
if (firstEnabledEnding.type !== "redirectToUrl") {
|
||||
const firstEnabledEnding = survey.endings?.[0];
|
||||
if (firstEnabledEnding?.type !== "redirectToUrl") {
|
||||
close();
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user