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 initialState = { | |
| username: "", | |
| email: "", | |
| displayname: "", | |
| token: "", | |
| error: null, | |
| isLoading: false, | |
| redirectURL: "/" | |
| }; |
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
| { | |
| "code": "jwt_auth_failed", | |
| "data": { | |
| "status": 403 | |
| }, | |
| "message": "Invalid Credentials." | |
| } |
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 { Switch, Route, Redirect } from "react-router-dom"; | |
| import { connect } from "react-redux"; | |
| import * as actionMethods from "../../store/actions/index.actions"; | |
| import SignUp from "../../components/Auth/SignUp"; | |
| import SignIn from "../../components/Auth/SignIn"; | |
| import SignOut from "../../components/Auth/Signout"; | |
| class Auth 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 { Col, Form, InputGroup, FormGroup, Input, Button, InputGroupAddon, InputGroupText } from "reactstrap"; | |
| const signIn = (props) => { | |
| return ( | |
| <Col xs="12" md={{size:6, offset: 3}}> | |
| <h1 style={{textAlign: "center"}}>Sign In!</h1> | |
| <Form autoComplete="false"> | |
| <InputGroup className="mb-3"> | |
| <InputGroupAddon addonType="prepend"> |
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
| module.exports.getFile = (req, res) => { | |
| //Accepting user input directly is very insecure and should | |
| //never be allowed in a production app. | |
| //Sanitize the input before accepting it | |
| //This is for demonstration purposes only | |
| let fileName = req.body.text1; | |
| //Connect to the MongoDB client | |
| MongoClient.connect(url, function(err, client){ | |
| if(err){ |
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
| Stats { | |
| dev: 2114, | |
| ino: 48064969, | |
| mode: 33188, | |
| nlink: 1, | |
| uid: 85, | |
| gid: 100, | |
| rdev: 0, | |
| size: 527, | |
| blksize: 4096, |
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 { Container, Row, Col } from 'reactstrap'; | |
| import { withRouter } from 'react-router-dom'; | |
| import { connect } from 'react-redux'; | |
| import * as actionMethods from '../../store/actions/index.actions'; //Exports all action methods allowing easy import | |
| import Post from '../../components/Post/Post'; | |
| class Blog 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 axios from '../../axios-wp'; | |
| export const loadAllPosts = (perpage) => { | |
| //Load per_page count of posts from our WordPress installation | |
| return dispatch => { | |
| axios.get('/wp/v2/posts?per_page=' + perpage) | |
| .then(postsRes => { | |
| //Retrieve a list of all Media IDs from returned posts | |
| let mediaIds = []; | |
| postsRes.data.forEach(post => { |
NewerOlder