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
<template> | |
<div class="container"> | |
<div> | |
<logo /> | |
<h1 class="title"> | |
nuxt-auth0 | |
</h1> | |
<h2 class="subtitle"> | |
My neat Nuxt.js project | |
</h2> |
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({ route, app, redirect }) { | |
try { | |
const { appState } = await app.$auth0.handleRedirectCallback() | |
await app.router.push( | |
(appState && appState.targetUrl) || process.env.AUTH0_CALLBACK_ROUTE | |
) | |
} catch (e) { | |
try { | |
await app.$auth0.getTokenSilently() | |
} catch (e) { |
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 createAuth0Client from '@auth0/auth0-spa-js' | |
export default async function(ctx, inject) { | |
const $auth = await createAuth0Client({ | |
domain: '<DOMAIN_ID>', | |
client_id: '<CLIENT_ID>', | |
useRefreshTokens: true | |
}) | |
inject('auth0', $auth) |
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
exports.handler = async (event) => { | |
let addend1 = Number(event.queryStringParameters.addend1) | |
let addend2 = Number(event.queryStringParameters.addend2) | |
return { | |
body: JSON.stringify({ | |
"result": addend1 + addend2 | |
}) | |
} | |
} |
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 AWS = require('aws-sdk') | |
const dynamo = new AWS.DynamoDB() | |
exports.handler = async (event) => { | |
let params = { | |
ProjectionExpression: "code, description, price", | |
TableName: "product" | |
} | |
let data = await dynamo.scan(params).promise() |
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 AWS = require("aws-sdk"); | |
const gm = require('gm').subClass({ | |
imageMagick: true | |
}); | |
const s3 = new AWS.S3(); | |
const destinationBucket = process.env.DESTINATION_BUCKET | |
const resizeConfig = 200 | |
exports.handler = (event, context, callback) => { |