Skip to content

Commit

Permalink
feat: autocomplete license from query
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroAkbal committed Jul 13, 2024
1 parent b036fe4 commit f165f4f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions pages/premium/sign-in.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
password: ''
})
async function onSubmit(event: Event) {
async function onSubmit() {
const password = formData.value.password
if (!password) {
Expand All @@ -20,7 +20,7 @@
const authData = await $pocketBase.collection('users').authWithPassword(password, password)
} catch (error) {
if (error instanceof ClientResponseError) {
toast.error(`Error: "${error.message}", contact support if it keeps happening`)
toast.error(error.message)
return
}
}
Expand All @@ -31,11 +31,18 @@
onNuxtReady(() => {
const route = useRoute()
const message = route.query.message
const license = route.query.license
// TODO: Add action to contact support
if (message) {
toast.info(message)
}
if (license) {
formData.value.password = license
onSubmit()
}
})
useSeoMeta({
Expand Down
2 changes: 1 addition & 1 deletion plugins/030.pocketbase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default defineNuxtPlugin(async ({ app }) => {
secure: true,
sameSite: 'strict',
httpOnly: false,
maxAge: 60 * 60 * 24 * 90 // 90 days
maxAge: 60 * 60 * 24 * 90 // 90 days // Same as PocketBase config?
})

// load the store data from the cookie value
Expand Down

0 comments on commit f165f4f

Please sign in to comment.