├── .eslintrc.cjs
├── .gitignore
├── .prettierrc
├── .vscode
└── extensions.json
├── LICENSE
├── README.md
├── env.d.ts
├── index.html
├── package-lock.json
├── package.json
├── public
└── favicon.ico
├── src
├── App.vue
├── global.d.ts
├── guards
│ └── auth.ts
├── main.ts
├── router
│ └── index.ts
├── stores
│ └── auth.ts
├── supabase.ts
├── types.d.ts
└── views
│ ├── HomeView.vue
│ ├── ProfileView.vue
│ └── SignInView.vue
├── tsconfig.json
└── vite.config.ts
/.eslintrc.cjs:
--------------------------------------------------------------------------------
1 | /* eslint-env node */
2 |
3 | require('@rushstack/eslint-patch/modern-module-resolution');
4 |
5 | module.exports = {
6 | root: true,
7 | parser: 'vue-eslint-parser',
8 | parserOptions: {
9 | parser: '@typescript-eslint/parser',
10 | sourceType: 'module',
11 | ecmaVersion: 2021
12 | },
13 | extends: [
14 | 'plugin:vue/vue3-essential',
15 | 'eslint:recommended',
16 | '@vue/eslint-config-typescript/recommended',
17 | '@vue/eslint-config-prettier',
18 | 'prettier'
19 | ],
20 | rules: {
21 | 'prettier/prettier': 2
22 | },
23 | env: {
24 | 'vue/setup-compiler-macros': true
25 | }
26 | };
27 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | .DS_Store
12 | dist
13 | dist-ssr
14 | *.local
15 |
16 | /cypress/videos/
17 | /cypress/screenshots/
18 |
19 | # Editor directories and files
20 | .vscode/*
21 | !.vscode/extensions.json
22 | .idea
23 | *.suo
24 | *.ntvs*
25 | *.njsproj
26 | *.sln
27 | *.sw?
28 |
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "tabWidth": 2,
3 | "printWidth": 80,
4 | "useTabs": false,
5 | "singleQuote": true,
6 | "arrowParens": "always",
7 | "trailingComma": "none",
8 | "endOfLine": "lf"
9 | }
10 |
--------------------------------------------------------------------------------
/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": ["johnsoncodehk.volar", "johnsoncodehk.vscode-typescript-vue-plugin"]
3 | }
4 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 Mac (Maciej Pędzich)
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # vue-supabase-tpa-demo
2 |
3 | Demo application utilising Supabase for third party authentication (here with Github). Bear in mind **it is NOT** 100% production ready, it's just a demo after all.
4 |
5 | [Read about it on Hashnode](https://maciejpedzich.hashnode.dev/vue-supabase-github-oauth)
6 |
7 | ## Recommended IDE Setup
8 |
9 | [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.vscode-typescript-vue-plugin).
10 |
11 | ## Type Support for `.vue` Imports in TS
12 |
13 | TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.
14 |
15 | If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471) that is more performant. You can enable it by the following steps:
16 |
17 | 1. Disable the built-in TypeScript Extension
18 | 1) Run `Extensions: Show Built-in Extensions` from VSCode's command palette
19 | 2) Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
20 | 2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
21 |
22 | ## Customize configuration
23 |
24 | See [Vite Configuration Reference](https://vitejs.dev/config/).
25 |
26 | ## Project Setup
27 |
28 | ```sh
29 | npm install
30 | ```
31 |
32 | ### Compile and Hot-Reload for Development
33 |
34 | ```sh
35 | npm run dev
36 | ```
37 |
38 | ### Type-Check, Compile and Minify for Production
39 |
40 | ```sh
41 | npm run build
42 | ```
43 |
44 | ### Lint with [ESLint](https://eslint.org/)
45 |
46 | ```sh
47 | npm run lint
48 | ```
49 |
--------------------------------------------------------------------------------
/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
Go to {{ routerLinkDestination }} page
23 |Take me back home
19 |Please wait...
27 | 28 | 29 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": "./", 4 | "target": "esnext", 5 | "useDefineForClassFields": true, 6 | "module": "esnext", 7 | "moduleResolution": "node", 8 | "isolatedModules": true, 9 | "strict": true, 10 | "jsx": "preserve", 11 | "sourceMap": true, 12 | "resolveJsonModule": true, 13 | "esModuleInterop": true, 14 | "paths": { 15 | "@/*": ["src/*"] 16 | }, 17 | "lib": ["esnext", "dom", "dom.iterable", "scripthost"], 18 | "skipLibCheck": true 19 | }, 20 | "include": ["vite.config.*", "env.d.ts", "src/**/*", "src/**/*.vue"] 21 | } 22 | -------------------------------------------------------------------------------- /vite.config.ts: -------------------------------------------------------------------------------- 1 | import { fileURLToPath, URL } from 'url' 2 | 3 | import { defineConfig } from 'vite' 4 | import vue from '@vitejs/plugin-vue' 5 | 6 | // https://vitejs.dev/config/ 7 | export default defineConfig({ 8 | plugins: [vue()], 9 | resolve: { 10 | alias: { 11 | '@': fileURLToPath(new URL('./src', import.meta.url)) 12 | } 13 | } 14 | }) 15 | --------------------------------------------------------------------------------