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
| // Based on: https://github.com/tastejs/todomvc/blob/gh-pages/examples/react/js/app.jsx | |
| import React, { Component } from "react"; | |
| import { | |
| ReactiveBase, | |
| ReactiveList, | |
| TextField, | |
| DataController | |
| } from "@appbaseio/reactivesearch"; |
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 React from 'react'; | |
| const Callback = () => ( | |
| <div className="loading"> | |
| <h4>Loading...</h4> | |
| </div> | |
| ); | |
| export default Callback; |
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 auth0 from 'auth0-js'; | |
| import history from './history'; | |
| export default class Auth { | |
| // Please use your own credentials here | |
| auth0 = new auth0.WebAuth({ | |
| domain: 'divyanshu.auth0.com', | |
| clientID: 'gnXmrO24CGNBuYtfGgblgOHM2GESYQ5N', | |
| redirectUri: process.env.NODE_ENV === 'development' ? 'http://localhost:8001/callback' : 'https://appbaseio-apps.github.io/todomvc-auth-client/callback', |
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 createHistory from 'history/createBrowserHistory'; | |
| export default createHistory({ | |
| basename: process.env.NODE_ENV === 'development' ? '/' : '/todomvc-auth-client' | |
| }); |
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 express = require('express'); | |
| const cors = require('cors'); | |
| const bodyParser = require('body-parser'); | |
| const morgan = require('morgan'); | |
| const jwt = require('express-jwt'); | |
| const jwksRsa = require('jwks-rsa'); | |
| const Appbase = require('appbase-js'); | |
| // middlewares | |
| const app = express(); |
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 React, { Component } from "react"; | |
| import ReactDOM from "react-dom"; | |
| import classNames from "classnames"; | |
| import ReactTooltip from 'react-tooltip'; | |
| import { TextField } from "@appbaseio/reactivesearch"; | |
| const ESCAPE_KEY = 27; | |
| const ENTER_KEY = 13; | |
| class TodoItem extends Component { |
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 React from 'react'; | |
| import ReactDOM from 'react-dom'; | |
| import '@appbaseio/reactivesearch/dist/css/style.min.css'; | |
| import './index.css'; | |
| import Routes from './Routes'; | |
| import registerServiceWorker from './registerServiceWorker'; | |
| ReactDOM.render(<Routes />, document.getElementById('root')); | |
| registerServiceWorker(); |
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 createHistory from 'history/createBrowserHistory'; | |
| export default createHistory({ | |
| basename: process.env.NODE_ENV === 'development' ? '' : '/reactivesearch-auth0-example' | |
| }); |
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 React from 'react'; | |
| import { Route, Router } from 'react-router-dom'; | |
| import Home from './Home'; | |
| import Callback from './Callback'; | |
| import Auth from './auth'; | |
| import history from './history'; | |
| const auth = new Auth(); | |
| const handleAuthentication = (nextState, replace) => { |
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 React from 'react'; | |
| const Callback = () => ( | |
| <div className="container"> | |
| <h4>Loading...</h4> | |
| </div> | |
| ); | |
| export default Callback; |