Fix automatic logout on authentication error

(yet another attempt)
This commit is contained in:
silverpill 2023-03-19 23:06:24 +00:00
parent e2c915a256
commit 2b9ded4a95
2 changed files with 6 additions and 5 deletions

View file

@ -14,6 +14,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Show better error message if HTTP status code is 413.
### Fixed
- Fixed automatic logout on authentication error.
## [1.17.0] - 2023-03-15
### Added
@ -25,10 +29,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Show alert if publishing of reply fails.
- Show alert if attachment upload fails.
### Fixed
- Fixed automatic logout on authentication error.
## [1.16.0] - 2023-03-08
### Added

View file

@ -26,7 +26,7 @@ import SidebarLayout from "@/components/SidebarLayout.vue"
import { useCurrentUser } from "@/store/user"
const router = useRouter()
const { ensureAuthToken, ensureCurrentUser } = useCurrentUser()
const { endUserSession, ensureAuthToken, ensureCurrentUser } = useCurrentUser()
let posts = $ref<Post[]>([])
let isLoading = $ref(false)
@ -47,6 +47,7 @@ async function loadTimeline() {
posts = await getHomeTimeline(authToken)
} catch (error: any) {
if (error.message === "access token is invalid") {
await endUserSession()
router.push({ name: "landing-page" })
return
} else {