6 |
7 | ExampleComponent text
8 |
9 |
10 |
--------------------------------------------------------------------------------
/components/auth/types.ts:
--------------------------------------------------------------------------------
1 | export interface LoginForm {
2 | data: {
3 | email: string,
4 | password: string
5 | },
6 | errors: object,
7 | pending: boolean
8 | }
9 |
--------------------------------------------------------------------------------
/.env.example:
--------------------------------------------------------------------------------
1 | NUXT_API_SECRET=api_secret_token
2 | NUXT_PUBLIC_API_BASE=https://example.com/api/
3 |
4 | COOKIE_NAME=__session
5 | COOKIE_SECRET=secret
6 | COOKIE_EXPIRES=604800000 # 1 week
7 |
--------------------------------------------------------------------------------
/store/user/getters.ts:
--------------------------------------------------------------------------------
1 | import { UserState } from './state';
2 |
3 | const getters = {
4 | getUser({ user }: UserState) {
5 | return user;
6 | }
7 | };
8 |
9 | export default getters;
10 |
--------------------------------------------------------------------------------
/app.vue:
--------------------------------------------------------------------------------
1 |
6 |
7 |