Skip to content

Commit ba8f07d

Browse files
committed
Add option in embed auth to handle errors safely
1 parent c71d54d commit ba8f07d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

web/src/app/api/auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export default {
8181

8282
async embedAuth(token: string) {
8383
try {
84-
const response = await axios.post(`${API_BASE_URL}/embed`, { token });
84+
const response = await axios.post(`${API_BASE_URL}/embed`, { token, handle_safely: true });
8585
return response.data;
8686
} catch (error) {
8787
console.error('Error during embed auth:', error);

web/src/components/common/App.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,10 @@ const AppBody = forwardRef((_props, ref) => {
437437
if (mx_token) {
438438
try {
439439
const embedAuthResult = await authModule.embedAuth(mx_token)
440-
const { session_jwt, profile_id, email } = embedAuthResult
440+
const { session_jwt, profile_id, email, is_failed } = embedAuthResult
441+
if (is_failed) {
442+
return
443+
}
441444
if (email != currentEmail) {
442445
resetState()
443446
}

0 commit comments

Comments
 (0)