This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ yarn add nuxt-basic-auth-module |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 現実 | |
const { app, h } = hyperapp | |
/** @jsx h */ | |
const state = { | |
isInited: false, | |
users: [] | |
} | |
const actions = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const state = () => ({ | |
isCalled: false | |
}) | |
export const getters = { | |
isCalled: (state) => state.isCalled | |
} | |
export const mutations = { | |
setIsCalled(state) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ejs = require('ejs') | |
const util = require('util') | |
const promisify = util.promisify | |
const inspect = util.inspect | |
const glob = promisify(require('glob')) | |
const fs = require('fs') | |
const chalk = require('chalk') | |
const moment = require('moment') | |
const markdownIt = require('markdown-it') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default async function(context) { | |
- const { app, store, route, redirect, isServer, req } = context | |
+ const { app, store, route, redirect, req } = context | |
- if (isServer) { | |
+ if (process.server) { | |
// 認証の処理 | |
} else { | |
// クライアントでの処理 | |
} | |
// ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body data-n-head=""> | |
<div data-server-rendered="true" id="__nuxt"><div class="nuxt-progress" style="width:0%;height:2px;background-color:#3B8070;opacity:0;"></div><div id="__layout"><div><div><h1>Hello</h1><div class="no-ssr-placeholder"></div></div></div></div></div><script type="text/javascript">window.__NUXT__={"layout":"default","data":[{}],"error":null,"serverRendered":true};</script><script src="/_nuxt/manifest.js" defer></script><script src="/_nuxt/vendor.js" defer></script><script src="/_nuxt/app.js" defer></script> | |
</body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Joi from 'joi-browser' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="app"> | |
<p>Component:</p> | |
<template v-if="isEdit"> | |
<input type="text" :value="foo" @input="onInput"> | |
<button type="button" @click="toggleEdit">Cancel</button> | |
</template> | |
<template v-else> | |
<span>{{foo}}</span> | |
<button type="button" @click="toggleEdit">Edit</button> | |
</template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import firebase from 'firebase' | |
const provider = new firebase.auth.GoogleAuthProvider() | |
firebase.auth().signInWithRedirect(provider) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const accountKeys = [ | |
'id', | |
'name', | |
'bio' | |
]; |