We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 132ab9d commit 021f761Copy full SHA for 021f761
web/src/components/common/Auth.tsx
@@ -182,6 +182,7 @@ const Auth = () => {
182
const currentEmail = useSelector((state: RootState) => state.settings.currentEmail)
183
184
useEffect(() => {
185
+ let tries = 1
186
const checkToken = async () => {
187
const mx_token = await getMXToken()
188
@@ -198,10 +199,14 @@ const Auth = () => {
198
199
email,
200
}))
201
dispatch(setCurrentEmail(email))
202
+ return
203
} catch (error) {
204
console.error('Failed to authenticate embed token:', error)
205
}
206
207
+ if (tries < 3) {
208
+ setTimeout(checkToken, (tries++) * 1000)
209
+ }
210
211
if (isEmbedded) {
212
checkToken()
0 commit comments