diff --git a/client/components/cards/LazyBookCard.vue b/client/components/cards/LazyBookCard.vue index 41b733107..35c959fad 100644 --- a/client/components/cards/LazyBookCard.vue +++ b/client/components/cards/LazyBookCard.vue @@ -198,7 +198,7 @@ export default { return this.store.getters['user/getSizeMultiplier'] }, dateFormat() { - return this.store.getters['getServerSetting']('dateFormat') + return this.store.state.serverSettings.dateFormat }, _libraryItem() { return this.libraryItem || {} diff --git a/client/components/cards/LazySeriesCard.vue b/client/components/cards/LazySeriesCard.vue index 34cea7e22..3532095b9 100644 --- a/client/components/cards/LazySeriesCard.vue +++ b/client/components/cards/LazySeriesCard.vue @@ -71,7 +71,7 @@ export default { return this.height * this.sizeMultiplier }, dateFormat() { - return this.store.getters['getServerSetting']('dateFormat') + return this.store.state.serverSettings.dateFormat }, labelFontSize() { if (this.width < 160) return 0.75 diff --git a/client/components/modals/BookmarksModal.vue b/client/components/modals/BookmarksModal.vue index d84a8ed88..de8c72b7e 100644 --- a/client/components/modals/BookmarksModal.vue +++ b/client/components/modals/BookmarksModal.vue @@ -79,10 +79,10 @@ export default { return !this.bookmarks.find((bm) => Math.abs(this.currentTime - bm.time) < 1) }, dateFormat() { - return this.$store.getters['getServerSetting']('dateFormat') + return this.$store.state.serverSettings.dateFormat }, timeFormat() { - return this.$store.getters['getServerSetting']('timeFormat') + return this.$store.state.serverSettings.timeFormat } }, methods: { diff --git a/client/components/modals/ListeningSessionModal.vue b/client/components/modals/ListeningSessionModal.vue index ecf00f787..a24698368 100644 --- a/client/components/modals/ListeningSessionModal.vue +++ b/client/components/modals/ListeningSessionModal.vue @@ -159,10 +159,10 @@ export default { return 'Unknown' }, dateFormat() { - return this.$store.getters['getServerSetting']('dateFormat') + return this.$store.state.serverSettings.dateFormat }, timeFormat() { - return this.$store.getters['getServerSetting']('timeFormat') + return this.$store.state.serverSettings.timeFormat }, isOpenSession() { return !!this._session.open diff --git a/client/components/modals/ShareModal.vue b/client/components/modals/ShareModal.vue index bd0c9acfb..24994b223 100644 --- a/client/components/modals/ShareModal.vue +++ b/client/components/modals/ShareModal.vue @@ -144,7 +144,7 @@ export default { expirationDateString() { if (!this.expireDurationSeconds) return this.$strings.LabelPermanent const dateMs = Date.now() + this.expireDurationSeconds * 1000 - return this.$formatDatetime(dateMs, this.$store.getters['getServerSetting']('dateFormat'), this.$store.getters['getServerSetting']('timeFormat')) + return this.$formatDatetime(dateMs, this.$store.state.serverSettings.dateFormat, this.$store.state.serverSettings.timeFormat) } }, methods: { diff --git a/client/components/modals/changelog/ViewModal.vue b/client/components/modals/changelog/ViewModal.vue index 939ee71d2..1b332a1d5 100644 --- a/client/components/modals/changelog/ViewModal.vue +++ b/client/components/modals/changelog/ViewModal.vue @@ -40,7 +40,7 @@ export default { } }, dateFormat() { - return this.$store.getters['getServerSetting']('dateFormat') + return this.$store.state.serverSettings.dateFormat }, releasesToShow() { return this.versionData?.releasesToShow || [] diff --git a/client/components/tables/BackupsTable.vue b/client/components/tables/BackupsTable.vue index f769abdb0..769c8d25c 100644 --- a/client/components/tables/BackupsTable.vue +++ b/client/components/tables/BackupsTable.vue @@ -78,10 +78,10 @@ export default { return this.$store.getters['user/getToken'] }, dateFormat() { - return this.$store.getters['getServerSetting']('dateFormat') + return this.$store.state.serverSettings.dateFormat }, timeFormat() { - return this.$store.getters['getServerSetting']('timeFormat') + return this.$store.state.serverSettings.timeFormat } }, methods: { diff --git a/client/components/tables/UsersTable.vue b/client/components/tables/UsersTable.vue index c71710181..20f412288 100644 --- a/client/components/tables/UsersTable.vue +++ b/client/components/tables/UsersTable.vue @@ -76,10 +76,10 @@ export default { return usermap }, dateFormat() { - return this.$store.getters['getServerSetting']('dateFormat') + return this.$store.state.serverSettings.dateFormat }, timeFormat() { - return this.$store.getters['getServerSetting']('timeFormat') + return this.$store.state.serverSettings.timeFormat } }, methods: { diff --git a/client/components/tables/podcast/LazyEpisodeRow.vue b/client/components/tables/podcast/LazyEpisodeRow.vue index ee1899619..ae99e6d3e 100644 --- a/client/components/tables/podcast/LazyEpisodeRow.vue +++ b/client/components/tables/podcast/LazyEpisodeRow.vue @@ -112,7 +112,7 @@ export default { return this.episode?.publishedAt }, dateFormat() { - return this.store.getters['getServerSetting']('dateFormat') + return this.store.state.serverSettings.dateFormat }, itemProgress() { return this.store.getters['user/getUserMediaProgress'](this.libraryItemId, this.episodeId) diff --git a/client/components/tables/podcast/LazyEpisodesTable.vue b/client/components/tables/podcast/LazyEpisodesTable.vue index d23ee3d3b..b23cc5605 100644 --- a/client/components/tables/podcast/LazyEpisodesTable.vue +++ b/client/components/tables/podcast/LazyEpisodesTable.vue @@ -239,10 +239,10 @@ export default { }) }, dateFormat() { - return this.$store.getters['getServerSetting']('dateFormat') + return this.$store.state.serverSettings.dateFormat }, timeFormat() { - return this.$store.getters['getServerSetting']('timeFormat') + return this.$store.state.serverSettings.timeFormat } }, methods: { diff --git a/client/components/widgets/CronExpressionBuilder.vue b/client/components/widgets/CronExpressionBuilder.vue index 600ed81a1..77b5a54c5 100644 --- a/client/components/widgets/CronExpressionBuilder.vue +++ b/client/components/widgets/CronExpressionBuilder.vue @@ -85,7 +85,7 @@ export default { nextRun() { if (!this.cronExpression) return '' const parsed = this.$getNextScheduledDate(this.cronExpression) - return this.$formatJsDatetime(parsed, this.$store.getters['getServerSetting']('dateFormat'), this.$store.getters['getServerSetting']('timeFormat')) || '' + return this.$formatJsDatetime(parsed, this.$store.state.serverSettings.dateFormat, this.$store.state.serverSettings.timeFormat) || '' }, description() { if ((this.selectedInterval !== 'custom' || !this.selectedWeekdays.length) && this.selectedInterval !== 'daily') return '' diff --git a/client/cypress/tests/components/cards/LazySeriesCard.cy.js b/client/cypress/tests/components/cards/LazySeriesCard.cy.js index 12eec6924..346259d27 100644 --- a/client/cypress/tests/components/cards/LazySeriesCard.cy.js +++ b/client/cypress/tests/components/cards/LazySeriesCard.cy.js @@ -40,7 +40,6 @@ describe('LazySeriesCard', () => { }, $store: { getters: { - getServerSetting: () => 'MM/dd/yyyy', 'user/getUserCanUpdate': true, 'user/getUserMediaProgress': (id) => null, 'user/getSizeMultiplier': 1, diff --git a/client/pages/config/rss-feeds.vue b/client/pages/config/rss-feeds.vue index b5ba90a38..568239201 100644 --- a/client/pages/config/rss-feeds.vue +++ b/client/pages/config/rss-feeds.vue @@ -78,10 +78,10 @@ export default { }, computed: { dateFormat() { - return this.$store.getters['getServerSetting']('dateFormat') + return this.$store.state.serverSettings.dateFormat }, timeFormat() { - return this.$store.getters['getServerSetting']('timeFormat') + return this.$store.state.serverSettings.timeFormat } }, methods: { diff --git a/client/pages/config/sessions.vue b/client/pages/config/sessions.vue index 135922d39..0b1bdaa7a 100644 --- a/client/pages/config/sessions.vue +++ b/client/pages/config/sessions.vue @@ -250,10 +250,10 @@ export default { return user?.username || null }, dateFormat() { - return this.$store.getters['getServerSetting']('dateFormat') + return this.$store.state.serverSettings.dateFormat }, timeFormat() { - return this.$store.getters['getServerSetting']('timeFormat') + return this.$store.state.serverSettings.timeFormat }, numSelected() { return this.listeningSessions.filter((s) => s.selected).length diff --git a/client/pages/config/users/_id/index.vue b/client/pages/config/users/_id/index.vue index b48147d3d..b87d10c32 100644 --- a/client/pages/config/users/_id/index.vue +++ b/client/pages/config/users/_id/index.vue @@ -132,10 +132,10 @@ export default { return this.listeningSessions.sessions[0] }, dateFormat() { - return this.$store.getters['getServerSetting']('dateFormat') + return this.$store.state.serverSettings.dateFormat }, timeFormat() { - return this.$store.getters['getServerSetting']('timeFormat') + return this.$store.state.serverSettings.timeFormat } }, methods: { diff --git a/client/pages/config/users/_id/sessions.vue b/client/pages/config/users/_id/sessions.vue index 764983d73..ab33b4b1c 100644 --- a/client/pages/config/users/_id/sessions.vue +++ b/client/pages/config/users/_id/sessions.vue @@ -98,10 +98,10 @@ export default { return this.$store.getters['users/getIsUserOnline'](this.user.id) }, dateFormat() { - return this.$store.getters['getServerSetting']('dateFormat') + return this.$store.state.serverSettings.dateFormat }, timeFormat() { - return this.$store.getters['getServerSetting']('timeFormat') + return this.$store.state.serverSettings.timeFormat } }, methods: { diff --git a/client/pages/item/_id/index.vue b/client/pages/item/_id/index.vue index 1d8f0f20b..6042f92a2 100644 --- a/client/pages/item/_id/index.vue +++ b/client/pages/item/_id/index.vue @@ -193,7 +193,7 @@ export default { return `${process.env.serverUrl}/api/items/${this.libraryItemId}/download?token=${this.userToken}` }, dateFormat() { - return this.$store.getters['getServerSetting']('dateFormat') + return this.$store.state.serverSettings.dateFormat }, userIsAdminOrUp() { return this.$store.getters['user/getIsAdminOrUp'] diff --git a/client/pages/library/_library/podcast/latest.vue b/client/pages/library/_library/podcast/latest.vue index 4f12043e1..4da25f3ec 100644 --- a/client/pages/library/_library/podcast/latest.vue +++ b/client/pages/library/_library/podcast/latest.vue @@ -141,7 +141,7 @@ export default { return episodeIds }, dateFormat() { - return this.$store.getters['getServerSetting']('dateFormat') + return this.$store.state.serverSettings.dateFormat } }, methods: { diff --git a/client/pages/login.vue b/client/pages/login.vue index a9d445614..5d447ed9b 100644 --- a/client/pages/login.vue +++ b/client/pages/login.vue @@ -305,8 +305,8 @@ export default { }, async mounted() { // Token passed as query parameter after successful oidc login - if (this.$route.query?.accessToken) { - localStorage.setItem('token', this.$route.query.accessToken) + if (this.$route.query?.setToken) { + localStorage.setItem('token', this.$route.query.setToken) } if (localStorage.getItem('token')) { if (await this.checkAuth()) return // if valid user no need to check status diff --git a/server/Auth.js b/server/Auth.js index 1d229ceb3..601fe8f24 100644 --- a/server/Auth.js +++ b/server/Auth.js @@ -266,8 +266,7 @@ class Auth { if (req.cookies.auth_cb) { let stateQuery = req.cookies.auth_state ? `&state=${req.cookies.auth_state}` : '' // UI request -> redirect to auth_cb url and send the jwt token as parameter - // TODO: Temporarily continue sending the old token as setToken - res.redirect(302, `${req.cookies.auth_cb}?setToken=${userResponse.user.token}&accessToken=${userResponse.user.accessToken}${stateQuery}`) + res.redirect(302, `${req.cookies.auth_cb}?setToken=${userResponse.user.accessToken}${stateQuery}`) } else { res.status(400).send('No callback or already expired') }