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 Vue from "vue"; | |
import Vuex from "vuex"; | |
import addSeconds from "date-fns/add_seconds"; | |
Vue.use(Vuex); | |
const Store = new Vuex.Store({ | |
state() { | |
return { | |
idToken: localStorage.getItem("idToken"), | |
accessToken: localStorage.getItem("accessToken"), |
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 Store from "../store/index"; | |
import Router from "../router/index"; | |
import isAfter from "date-fns/is_after"; | |
import subtractMinutes from "date-fns/sub_minutes"; | |
import addSeconds from "date-fns/add_seconds"; | |
import differenceInMinutes from "date-fns/difference_in_minutes"; | |
import differenceInMilliSeconds from "date-fns/difference_in_milliseconds"; | |
export {initSession}; |
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
mutations: { | |
update_auth_tokens(state, tokenData) { | |
localStorage.setItem("accessToken", tokenData.access_token || tokenData.accessToken); //sometimes tokens are in snake case and other times they are in camelcase :/ | |
localStorage.setItem("access_token", tokenData.access_token || tokenData.accessToken); | |
state.accessToken = localStorage.getItem("accessToken"); | |
localStorage.setItem("idToken", tokenData.id_token || tokenData.idToken); | |
localStorage.setItem("id_token", tokenData.id_token || tokenData.idToken); | |
state.idToken = localStorage.getItem("idToken"); |
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
<template> | |
<div> | |
</div> | |
</template> | |
<script> | |
import querystring from "querystring"; | |
export default { | |
name: "LogInCallback", |
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
<template> | |
<div> | |
</div> | |
</template> | |
<script> | |
export default { | |
name: "Login", | |
mounted() { | |
auth0.authorize(); |
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
"use strict"; | |
const app = require("express")(); | |
const bodyParser = require("body-parser"); | |
const request = require("request"); | |
const cors = require("cors"); | |
app.use(cors()); | |
app.use(bodyParser.json()); |
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
new Vue({ | |
el: '#app', | |
components: { | |
'vue-recaptcha': VueRecaptcha | |
}, | |
methods: { | |
submit: function () { | |
// this.status = "submitting"; | |
this.$refs.recaptcha.execute(); | |
}, |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" href="style.css"/> | |
<title>Vue Recaptcha Demo </title> | |
</head> | |
<body> | |
<div id="app"> | |
<div> |
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
<div class="auth-form-wrapper"> | |
<form class="auth-form" @submit.prevent="submit"> | |
<div class="header"> | |
<h1> | |
Sign up | |
</h1> | |
</div> | |
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
request.get({ | |
url: url, | |
json: true, | |
headers: {'User-Agent': 'request'} | |
}, onResponse); | |
function onResponse(err, res, data) { | |
if (err) { | |
console.log('Error:', err); | |
} else if (res.statusCode !== 200) { |
NewerOlder