Skip to content

Commit

Permalink
feat: 🔖 release 2.1.1 - GPLV2 License, auth & docker bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
CRBroughton committed Nov 21, 2023
2 parents 2e84667 + 7a05546 commit 3cfbd8f
Show file tree
Hide file tree
Showing 7 changed files with 378 additions and 6 deletions.
13 changes: 11 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
# Forager

## 2.1.1

### Patch Changes

- f03137f: Hide menu if users home location is not set.
- f03137f: Fix docker volume binding.
- 0c0e4e9: Failed authenticated refreshes will now log the user out.
- a305ee1b: Add GPLV2 license.

## 2.1.0

### Minor Changes

- 2f5dabb: Users can now create landmarks - Users are now able to create landmarks. This feature
re-purposes the arbitrary item menu to allow users to
re-purposes the arbitrary item menu to allow users to
add landmarks to the map. Landmarks, like items, can also be deleted.
- a021252: move calendar month component to images menu - Previously, all added items of interest could not have
their calendar months customised. You can now customise
items 'startMonth' and 'endMonth' months, the months
you can expect to find this item in the wild. Any existing
items you have will need to be manually edited.

### Patch Changes

- 68ed2d7: Include Docker deployment options - Forager can now be deployed with a Docker image
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM alpine:latest

ARG FORAGER_VERSION=2.1.0
ARG FORAGER_VERSION=2.1.1

RUN apk add --no-cache \
unzip \
Expand Down
339 changes: 339 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "forager",
"version": "2.1.0",
"version": "2.1.1",
"scripts": {
"dev": "vite --host",
"build": "vue-tsc --noEmit && vite build",
Expand Down
1 change: 1 addition & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ const settingsMenuVisible = ref(false)
</Transition>
<ServerHealth />
<SideMenu
v-if="!homeNotSet"
:open-settings="openSettingsMenu"
/>
<Transition name="slide">
Expand Down
25 changes: 24 additions & 1 deletion src/pocketbase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,23 @@ import type { ItemsRecordWithID, LandmarksRecordWithID, UserRecordWithID } from

export const isError = (err: unknown): err is Error => err instanceof Error


interface AuthError {
code: number
message: string
data: AuthErrorData
}

interface AuthErrorData {
code: number
message: string
data: Record<string, string>
}

function isAuthError(err: unknown): err is AuthError {
return (err as AuthError).data.message === 'The request requires valid record authorization token to be set.' && (err as AuthError).data.code === 401
}

const state = useStorage('forager-store', {
server: import.meta.env.VITE_POCKETBASE_URL,
})
Expand Down Expand Up @@ -40,6 +57,7 @@ export const usePocketBase = defineStore('pocketbase-store', () => {
health.value = response
}
catch (error: unknown) {

if (isError(error))
setErrorMessage(error)
health.value = undefined
Expand All @@ -56,6 +74,7 @@ export const usePocketBase = defineStore('pocketbase-store', () => {
return 'success'
}
catch (error: unknown) {

if (isError(error))
setErrorMessage(error)
}
Expand Down Expand Up @@ -132,8 +151,12 @@ export const usePocketBase = defineStore('pocketbase-store', () => {
try {
await pb.collection('users').authRefresh()
}

catch (error: unknown) {
if (isError(error))
if (isError(error) && isAuthError(error))
pb.authStore.clear()

if (isError(error))
setErrorMessage(error)
}
}
Expand Down
2 changes: 1 addition & 1 deletion taskfile.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'

vars:
version: 2.1.0
version: 2.1.1

tasks:
build:
Expand Down

0 comments on commit 3cfbd8f

Please sign in to comment.