Don't log errors for known app password issues in chat (#9268)

This commit is contained in:
Eric Bailey
2025-10-23 11:18:53 -05:00
committed by GitHub
parent 74cb81b65f
commit c00b3d1050
3 changed files with 24 additions and 9 deletions
+9
View File
@@ -1,3 +1,4 @@
import {XRPCError} from '@atproto/xrpc'
import {t} from '@lingui/macro'
export function cleanError(str: any): string {
@@ -43,3 +44,11 @@ export function isNetworkError(e: unknown) {
}
return false
}
export function isErrorMaybeAppPasswordPermissions(e: unknown) {
if (e instanceof XRPCError && e.error === 'TokenInvalid') {
return true
}
const str = String(e)
return str.includes('Bad token scope') || str.includes('Bad token method')
}