Skip to content

Instantly share code, notes, and snippets.

View Bensigo's full-sized avatar
🚀

Bensigo Egwey Bensigo

🚀
View GitHub Profile
const jwt = require('jsonwebtoken')
const config = require('./config')
module.exports = async req => {
// check for token in headers
const token = req.headers.authorization
try {
const {user} = await jwt.verify(token, config.SECRET)
// asign the user to req.user
req.user = user
@Bensigo
Bensigo / Button.Vue
Last active February 18, 2020 06:23
<template>
<div>
<div class="demo-wrapper">
<cb-structured section="demo-fields-button" :schema="schema">
<template v-slot:content="props" >
<button :class="props.content.myButton.style" @click="clicked">{{props.content.myButton.label}}</button>
<raw-output :content="props"></raw-output>
</template>
</cb-structured>
</div>