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, Redirect } from 'react-router-dom'; | |
| const PrivateRoute = ({ component: Component, authed, ...rest }) => ( | |
| <Route | |
| {...rest} | |
| render={props => ( | |
| authed | |
| ? <Component {...props} /> | |
| : <Redirect to="/login" /> |
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 jwt | |
| from django.conf import settings | |
| from django.contrib.auth.models import User | |
| from rest_framework import exceptions | |
| from rest_framework.authentication import TokenAuthentication | |
| class JSONWebTokenAuthentication(TokenAuthentication): |
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
| // moment.js locale configuration | |
| // locale : brazilian portuguese (pt-br) | |
| // author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira | |
| (function (factory) { | |
| if (typeof define === 'function' && define.amd) { | |
| define(['moment'], factory); // AMD | |
| } else if (typeof exports === 'object') { | |
| module.exports = factory(require('../moment')); // Node | |
| } else { |
