File tree Expand file tree Collapse file tree 7 files changed +11
-57
lines changed Expand file tree Collapse file tree 7 files changed +11
-57
lines changed Original file line number Diff line number Diff line change 11{
2- "name" : " graphql- react" ,
2+ "name" : " react-firebase " ,
33 "version" : " 1.0.0" ,
4- "description" : " Project to practice the Graphql with react " ,
4+ "description" : " React + Firebase Authentications " ,
55 "main" : " index.js" ,
66 "scripts" : {
77 "dev" : " parcel src/index.html --open --port 5050" ,
88 "test" : " echo \" Error: no test specified\" && exit 1"
99 },
1010 "repository" : {
1111 "type" : " git" ,
12- "url" : " git@github.com-junip:junipdewan/graphql- react.git"
12+ "url" : " git@github.com-junip:junipdewan/react-firebase .git"
1313 },
14- "author" : " " ,
15- "license" : " ISC " ,
14+ "author" : " Junip Dewan<junipd2@gmail.com> " ,
15+ "license" : " MIT " ,
1616 "dependencies" : {
17- "@apollo/react-hooks" : " ^3.1.5" ,
18- "@types/react" : " ^16.9.35" ,
19- "apollo-boost" : " ^0.4.9" ,
2017 "firebase" : " ^7.15.0" ,
21- "graphql" : " ^15.0.0" ,
2218 "node-sass" : " ^4.14.1" ,
2319 "parcel-bundler" : " ^1.12.4" ,
2420 "react" : " ^16.13.1" ,
Original file line number Diff line number Diff line change @@ -5,20 +5,16 @@ import {
55 Route ,
66} from "react-router-dom" ;
77
8+
9+ import PrivateRoute from '../src/Routes/PrivateRoute'
10+ import { AuthProvider } from './context/AuthContext'
11+
812// paths
913import Login from './components/Login'
1014import Register from './components/Register'
1115import AuthenticatedApp from './components/AuthenticatedApp'
1216import './scss/main.scss'
1317
14- import PrivateRoute from '../src/Routes/PrivateRoute'
15-
16- import { AuthProvider } from './context/AuthContext'
17-
18- // const client = new ApolloClient({
19- // uri: 'https://countries-274616.ew.r.appspot.com/'
20- // })
21-
2218const App = ( ) => {
2319
2420 return (
Original file line number Diff line number Diff line change @@ -9,10 +9,9 @@ const AuthenticatedApp = () => {
99const logOut = ( ) => {
1010
1111 app . auth ( ) . signOut ( ) . then ( ( response ) => {
12- console . log ( response )
1312 history . push ( '/login' ) ;
1413 } ) . catch ( ( error ) => {
15- console . log ( error )
14+ console . error ( error )
1615 } )
1716}
1817
Original file line number Diff line number Diff line change @@ -19,15 +19,12 @@ const Register = () => {
1919 const registerUser = ( ) => {
2020 app . auth ( ) . createUserWithEmailAndPassword ( email , pass ) . then ( ( response ) => {
2121 if ( response ) {
22- console . log ( "----" , response )
2322 history . push ( '/login' )
2423 }
2524 } ) . catch ( function ( error ) {
26- // Handle Errors here.
2725 var errorCode = error . code ;
2826 var errorMessage = error . message ;
29- // ...
30- console . log ( errorMessage , errorCode ) ;
27+ console . error ( errorMessage , errorCode ) ;
3128 } )
3229 }
3330
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -10,11 +10,9 @@ export const AuthProvider = ({ children }) => {
1010 app . auth ( ) . onAuthStateChanged ( ( user ) => {
1111 setPending ( true )
1212 if ( user ) {
13- console . log ( "__" , user )
1413 setCurrentUser ( user )
1514 setPending ( false )
1615 } else {
17- console . log ( "err" , user )
1816 setCurrentUser ( null )
1917 setPending ( false )
2018 }
You can’t perform that action at this time.
0 commit comments