Skip to content

Commit

Permalink
feat: basic auth
Browse files Browse the repository at this point in the history
  • Loading branch information
qin-guan committed Sep 20, 2023
1 parent c8ab8df commit 510230a
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
41 changes: 41 additions & 0 deletions components/app/auth/page.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<script setup lang="ts">
import { signInWithEmailAndPassword } from 'firebase/auth'
import { f7List, f7ListButton, f7ListInput, f7LoginScreenTitle, f7NavLeft, f7NavTitle, f7NavTitleLarge, f7Navbar, f7Page } from 'framework7-vue'
const auth = useFirebaseAuth()
const state = reactive({
email: '',
password: '',
})
async function login() {
signInWithEmailAndPassword(auth!, state.email, state.password)
}
</script>

<template>
<f7Page login-screen no-toolbar no-navbar no-swipeback>
<f7LoginScreenTitle>SSTAA Login</f7LoginScreenTitle>
<f7List form>
<f7ListInput
v-model:value="state.email"
label="Email"
type="email"
placeholder="Your email (example: aurelius@sst.edu.sg)"
/>
<f7ListInput
v-model:value="state.password"
label="Password"
type="password"
placeholder="Your password"
error-message="Nice"
/>
</f7List>
<f7List inset>
<f7ListButton @click="login">
Login
</f7ListButton>
</f7List>
</f7Page>
</template>
5 changes: 5 additions & 0 deletions pages/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ const appRoutes = [
path: '/app/events',
asyncComponent: () => import('~/components/app/events/page.vue'),
},
{
name: 'auth',
path: '/app/auth',
asyncComponent: () => import('~/components/app/auth/page.vue'),
},
]
useSeoMeta({
Expand Down
3 changes: 3 additions & 0 deletions pages/app/auth.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<template>
<AppAuthPage />
</template>

0 comments on commit 510230a

Please # to comment.