├── nuxt
├── store
│ ├── index.js
│ └── README.md
├── static
│ ├── favicon.ico
│ └── README.md
├── .env.example
├── .gitignore
├── components
│ ├── README.md
│ └── AppLogo.vue
├── .editorconfig
├── layouts
│ ├── README.md
│ └── default.vue
├── pages
│ ├── README.md
│ ├── index.vue
│ └── login.vue
├── assets
│ └── README.md
├── plugins
│ └── README.md
├── middleware
│ └── README.md
├── README.md
├── .eslintrc.js
├── package.json
├── nuxt.config.js
└── auth
│ └── schemes
│ └── PassportPasswordScheme.js
├── laravel
├── public
│ ├── favicon.ico
│ ├── robots.txt
│ ├── .htaccess
│ └── index.php
├── database
│ ├── .gitignore
│ ├── seeds
│ │ └── DatabaseSeeder.php
│ ├── factories
│ │ └── UserFactory.php
│ └── migrations
│ │ ├── 2014_10_12_100000_create_password_resets_table.php
│ │ └── 2014_10_12_000000_create_users_table.php
├── storage
│ ├── logs
│ │ └── .gitignore
│ ├── app
│ │ ├── public
│ │ │ └── .gitignore
│ │ └── .gitignore
│ └── framework
│ │ ├── cache
│ │ └── .gitignore
│ │ ├── sessions
│ │ └── .gitignore
│ │ ├── testing
│ │ └── .gitignore
│ │ ├── views
│ │ └── .gitignore
│ │ └── .gitignore
├── bootstrap
│ ├── cache
│ │ └── .gitignore
│ └── app.php
├── .gitattributes
├── resources
│ ├── assets
│ │ ├── sass
│ │ │ ├── _variables.scss
│ │ │ └── app.scss
│ │ └── js
│ │ │ ├── components
│ │ │ └── ExampleComponent.vue
│ │ │ ├── app.js
│ │ │ └── bootstrap.js
│ ├── lang
│ │ └── en
│ │ │ ├── pagination.php
│ │ │ ├── auth.php
│ │ │ ├── passwords.php
│ │ │ └── validation.php
│ └── views
│ │ ├── home.blade.php
│ │ ├── auth
│ │ ├── passwords
│ │ │ ├── email.blade.php
│ │ │ └── reset.blade.php
│ │ ├── login.blade.php
│ │ └── register.blade.php
│ │ ├── welcome.blade.php
│ │ └── layouts
│ │ └── app.blade.php
├── .gitignore
├── tests
│ ├── TestCase.php
│ ├── Unit
│ │ └── ExampleTest.php
│ ├── Feature
│ │ └── ExampleTest.php
│ └── CreatesApplication.php
├── app
│ ├── Http
│ │ ├── Middleware
│ │ │ ├── EncryptCookies.php
│ │ │ ├── VerifyCsrfToken.php
│ │ │ ├── TrimStrings.php
│ │ │ ├── TrustProxies.php
│ │ │ └── RedirectIfAuthenticated.php
│ │ ├── Controllers
│ │ │ ├── Controller.php
│ │ │ ├── Api
│ │ │ │ └── AuthController.php
│ │ │ ├── HomeController.php
│ │ │ └── Auth
│ │ │ │ ├── ForgotPasswordController.php
│ │ │ │ ├── LoginController.php
│ │ │ │ ├── ResetPasswordController.php
│ │ │ │ └── RegisterController.php
│ │ └── Kernel.php
│ ├── Providers
│ │ ├── BroadcastServiceProvider.php
│ │ ├── AppServiceProvider.php
│ │ ├── EventServiceProvider.php
│ │ ├── AuthServiceProvider.php
│ │ └── RouteServiceProvider.php
│ ├── User.php
│ ├── Console
│ │ └── Kernel.php
│ └── Exceptions
│ │ └── Handler.php
├── README.md
├── routes
│ ├── channels.php
│ ├── web.php
│ ├── console.php
│ └── api.php
├── webpack.mix.js
├── server.php
├── config
│ ├── cors.php
│ ├── view.php
│ ├── services.php
│ ├── hashing.php
│ ├── broadcasting.php
│ ├── filesystems.php
│ ├── logging.php
│ ├── queue.php
│ ├── cache.php
│ ├── auth.php
│ ├── database.php
│ ├── mail.php
│ ├── session.php
│ └── app.php
├── .env.example
├── package.json
├── phpunit.xml
├── composer.json
└── artisan
├── docs
├── _config.yml
└── README.md
└── README.md
/nuxt/store/index.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/laravel/public/favicon.ico:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/laravel/database/.gitignore:
--------------------------------------------------------------------------------
1 | *.sqlite
2 |
--------------------------------------------------------------------------------
/docs/_config.yml:
--------------------------------------------------------------------------------
1 | theme: jekyll-theme-cayman
2 |
--------------------------------------------------------------------------------
/laravel/storage/logs/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/laravel/bootstrap/cache/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/laravel/public/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Disallow:
3 |
--------------------------------------------------------------------------------
/laravel/storage/app/public/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/laravel/storage/app/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !public/
3 | !.gitignore
4 |
--------------------------------------------------------------------------------
/laravel/storage/framework/cache/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/laravel/storage/framework/sessions/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/laravel/storage/framework/testing/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/laravel/storage/framework/views/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/nuxt/static/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jmschneider/nuxt-laravel-passport-example/HEAD/nuxt/static/favicon.ico
--------------------------------------------------------------------------------
/laravel/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
2 | *.css linguist-vendored
3 | *.scss linguist-vendored
4 | *.js linguist-vendored
5 | CHANGELOG.md export-ignore
6 |
--------------------------------------------------------------------------------
/laravel/storage/framework/.gitignore:
--------------------------------------------------------------------------------
1 | config.php
2 | routes.php
3 | schedule-*
4 | compiled.php
5 | services.json
6 | events.scanned.php
7 | routes.scanned.php
8 | down
9 |
--------------------------------------------------------------------------------
/nuxt/.env.example:
--------------------------------------------------------------------------------
1 | LARAVEL_ENDPOINT=http://laravel.test
2 | PASSPORT_CLIENT_ID=
3 | PASSPORT_CLIENT_SECRET=
4 | PASSPORT_PASSWORD_GRANT_ID=
5 | PASSPORT_PASSWORD_GRANT_SECRET=
--------------------------------------------------------------------------------
/nuxt/.gitignore:
--------------------------------------------------------------------------------
1 | # dependencies
2 | node_modules
3 |
4 | # logs
5 | npm-debug.log
6 |
7 | # Nuxt build
8 | .nuxt
9 |
10 | # Nuxt generate
11 | dist
12 |
13 | .env
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Example repo for [this nuxt auth-module issue](https://github.com/nuxt-community/auth-module/issues/24).
2 |
3 | * [Nuxt Readme](/nuxt/README.md)
4 | * [Laravel Readme](/laravel/README.md)
5 |
--------------------------------------------------------------------------------
/laravel/resources/assets/sass/_variables.scss:
--------------------------------------------------------------------------------
1 |
2 | // Body
3 | $body-bg: #f5f8fa;
4 |
5 | // Typography
6 | $font-family-sans-serif: "Raleway", sans-serif;
7 | $font-size-base: 0.9rem;
8 | $line-height-base: 1.6;
9 |
--------------------------------------------------------------------------------
/laravel/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules
2 | /public/hot
3 | /public/storage
4 | /storage/*.key
5 | /vendor
6 | /.idea
7 | /.vscode
8 | /.vagrant
9 | Homestead.json
10 | Homestead.yaml
11 | npm-debug.log
12 | yarn-error.log
13 | .env
14 |
--------------------------------------------------------------------------------
/laravel/tests/TestCase.php:
--------------------------------------------------------------------------------
1 | call(UsersTableSeeder::class);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/laravel/resources/assets/sass/app.scss:
--------------------------------------------------------------------------------
1 |
2 | // Fonts
3 | @import url("https://fonts.googleapis.com/css?family=Raleway:300,400,600");
4 |
5 | // Variables
6 | @import "variables";
7 |
8 | // Bootstrap
9 | @import '~bootstrap/scss/bootstrap';
10 |
11 | .navbar-laravel {
12 | background-color: #fff;
13 | box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
14 | }
15 |
--------------------------------------------------------------------------------
/nuxt/plugins/README.md:
--------------------------------------------------------------------------------
1 | # PLUGINS
2 |
3 | This directory contains your Javascript plugins that you want to run before instantiating the root vue.js application.
4 |
5 | More information about the usage of this directory in the documentation:
6 | https://nuxtjs.org/guide/plugins
7 |
8 | **This directory is not required, you can delete it if you don't want to use it.**
9 |
--------------------------------------------------------------------------------
/laravel/app/Http/Middleware/EncryptCookies.php:
--------------------------------------------------------------------------------
1 | assertTrue(true);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/nuxt/static/README.md:
--------------------------------------------------------------------------------
1 | # STATIC
2 |
3 | This directory contains your static files.
4 | Each file inside this directory is mapped to /.
5 |
6 | Example: /static/robots.txt is mapped as /robots.txt.
7 |
8 | More information about the usage of this directory in the documentation:
9 | https://nuxtjs.org/guide/assets#static
10 |
11 | **This directory is not required, you can delete it if you don't want to use it.**
12 |
--------------------------------------------------------------------------------
/laravel/app/Http/Middleware/VerifyCsrfToken.php:
--------------------------------------------------------------------------------
1 | get('/');
18 |
19 | $response->assertStatus(200);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/nuxt/README.md:
--------------------------------------------------------------------------------
1 | # Setup
2 |
3 | You will need to copy the `.env.example` file to `.env` and populate it with values from laravel.
4 |
5 | You can get `PASSPORT_CLIENT_ID` with `php artisan passport:client`.
6 |
7 | You can get `PASSPORT_PASSWORD_GRANT_ID` and `PASSPORT_PASSWORD_GRANT_SECRET` with `php artisan passport:client --password`.
8 |
9 | # Customizations
10 |
11 | Most of the work is done in [nuxt.config.js](nuxt.config.js) and [login.vue](pages/login.vue).
12 |
--------------------------------------------------------------------------------
/laravel/app/Http/Controllers/Api/AuthController.php:
--------------------------------------------------------------------------------
1 | json(['user' => auth()->user()]);
13 | }
14 |
15 | public function oauth()
16 | {
17 | return response()->json(auth()->user());
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/laravel/README.md:
--------------------------------------------------------------------------------
1 | # Setup
2 |
3 | You'll need to copy and configure `.env.example` to `.env` as usual. I also use `valet link` to access the site locally. Whatever URL you access the site from you will need to use in the nuxt `.env` file as `LARAVEL_ENDPOINT`.
4 |
5 | # Customizations
6 |
7 | See [line 29](https://github.com/jmschneider/nuxt-laravel-passport-example/blob/master/laravel/app/Providers/AuthServiceProvider.php#L29) in the `AuthServiceProvider` for how passport was set up.
8 |
--------------------------------------------------------------------------------
/laravel/tests/CreatesApplication.php:
--------------------------------------------------------------------------------
1 | make(Kernel::class)->bootstrap();
19 |
20 | return $app;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/laravel/app/Providers/BroadcastServiceProvider.php:
--------------------------------------------------------------------------------
1 | id === (int) $id;
16 | });
17 |
--------------------------------------------------------------------------------
/laravel/app/Http/Controllers/HomeController.php:
--------------------------------------------------------------------------------
1 | middleware('auth');
17 | }
18 |
19 | /**
20 | * Show the application dashboard.
21 | *
22 | * @return \Illuminate\Http\Response
23 | */
24 | public function index()
25 | {
26 | return view('home');
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/laravel/webpack.mix.js:
--------------------------------------------------------------------------------
1 | let mix = require('laravel-mix');
2 |
3 | /*
4 | |--------------------------------------------------------------------------
5 | | Mix Asset Management
6 | |--------------------------------------------------------------------------
7 | |
8 | | Mix provides a clean, fluent API for defining some Webpack build steps
9 | | for your Laravel application. By default, we are compiling the Sass
10 | | file for the application as well as bundling up all the JS files.
11 | |
12 | */
13 |
14 | mix.js('resources/assets/js/app.js', 'public/js')
15 | .sass('resources/assets/sass/app.scss', 'public/css');
16 |
--------------------------------------------------------------------------------
/laravel/routes/web.php:
--------------------------------------------------------------------------------
1 | name('home');
21 |
--------------------------------------------------------------------------------
/laravel/resources/lang/en/pagination.php:
--------------------------------------------------------------------------------
1 | '« Previous',
17 | 'next' => 'Next »',
18 |
19 | ];
20 |
--------------------------------------------------------------------------------
/laravel/routes/console.php:
--------------------------------------------------------------------------------
1 | comment(Inspiring::quote());
18 | })->describe('Display an inspiring quote');
19 |
--------------------------------------------------------------------------------
/laravel/server.php:
--------------------------------------------------------------------------------
1 |
8 | */
9 |
10 | $uri = urldecode(
11 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
12 | );
13 |
14 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the
15 | // built-in PHP web server. This provides a convenient way to test a Laravel
16 | // application without having installed a "real" web server software here.
17 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) {
18 | return false;
19 | }
20 |
21 | require_once __DIR__.'/public/index.php';
22 |
--------------------------------------------------------------------------------
/nuxt/pages/index.vue:
--------------------------------------------------------------------------------
1 |
2 | {{ strategy }}
6 | {{ $auth.user }}
10 |