This file contains 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 passwordlessAuth = Machine({ | |
id: 'passwordless', | |
initial: 'requestPhase', | |
context: { | |
phone: '', | |
hash:'', | |
otp:'' | |
}, | |
// main - states |
This file contains 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
// incase you want your custom nextjs modules to be imported as absolute paths | |
require('dotenv').config() | |
const path = require('path'); | |
module.exports ={ | |
env:{ | |
MY_STEP:process.env.MY_STEP | |
}, | |
serverRuntimeConfig: { |
This file contains 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 { NextApiRequest, NextApiResponse, } from "next" | |
import {serialize} from 'cookie' | |
export default async (req:NextApiRequest, res:NextApiResponse) => { | |
res.statusCode = 200 | |
console.log(req.statusCode) | |
if(req.method==='POST'){ |
This file contains 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
cccccc |
This file contains 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
cccccc |
This file contains 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 authentication = require('@feathersjs/authentication'); | |
const jwt = require('@feathersjs/authentication-jwt'); | |
const oauth2 = require('@feathersjs/authentication-oauth2'); | |
const GoogleStrategy = require('passport-google-oauth20'); | |
const EmailFirstOAuth2Verifier = require('./verifier'); | |
// Bring in the oauth-handler | |
const makeHandler = require('./oauth-handler'); | |
const callbackHook = hook => { | |
return async (req, res, next) => { |
This file contains 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
// track all authentication for the whole app at the very ancestor. then pass it on to all children | |
export default class MyApp extends App { | |
static async getInitialProps({ Component, ctx }) { | |
let pageProps = {} | |
if (Component.getInitialProps) { | |
pageProps = await Component.getInitialProps(ctx) |
This file contains 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 React, { Component, createRef } from 'react'; | |
import { | |
Menu, | |
Modal, | |
Header, | |
Button, | |
Icon, | |
Loader, | |
Container | |
} from 'semantic-ui-react'; |
This file contains 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
app | |
.service('stories') | |
.find() | |
.then(({ data }) => | |
data.map(({ title, goal, user }) => { | |
console.log(user); | |
if (user) { | |
const { id, avatar, firstname, lastname } = user; | |
return { | |
id, |
This file contains 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
/* eslint-disable no-console */ | |
import feathers from '@feathersjs/client'; | |
import io from 'socket.io-client'; | |
// require('dotenv').config(); | |
const url = | |
process.env.NODE_ENV === 'production' | |
? 'https://tvillage-s.herokuapp.com' |
NewerOlder