Skip to content

Commit

Permalink
fix(landing): redirect to auth main login form
Browse files Browse the repository at this point in the history
  • Loading branch information
Novout committed May 21, 2022
1 parent a7058fe commit abcf090
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
const onClick = () => {
isLoading.value = true
router.push('/landing').finally(() => {
router.push({ path: '/landing', query: { login: 'auth' } }).finally(() => {
isLoading.value = false
})
}
Expand Down
3 changes: 2 additions & 1 deletion packages/better-write-app/src/use/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ export const useEditor = () => {

const init = () => {
onMounted(() => {
if (!AUTH.account.user && network.isOnline.value) router.push('/landing')
if (!AUTH.account.user && network.isOnline.value)
router.push({ path: '/landing', query: { login: 'auth' } })

project.onLoadProject()
})
Expand Down
5 changes: 3 additions & 2 deletions packages/better-write-app/src/use/landing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ import { useI18n } from 'vue-i18n'
import { computed, onMounted, nextTick, ref } from 'vue'
import { useEnv } from '@/use/env'
import { useNProgress } from '@vueuse/integrations/useNProgress'
import { useRouter } from 'vue-router'
import { useRoute, useRouter } from 'vue-router'
import { s } from '@/use/storage/supabase'

export const useLanding = () => {
const { t } = useI18n()
const env = useEnv()
const router = useRouter()
const route = useRoute()
const { isLoading } = useNProgress()

const isNecessaryLogin = ref<boolean>(false)
const isNecessaryLogin = ref<boolean>(!!route.query.login)

onMounted(() => {
document.body.removeAttribute('class')
Expand Down

0 comments on commit abcf090

Please sign in to comment.