Skip to content

Commit

Permalink
Merge pull request #49 from webgem-xyz/LoginFixerino
Browse files Browse the repository at this point in the history
馃悰 Login fixerino
  • Loading branch information
Yannick committed Jan 19, 2018
2 parents 3970e19 + f0f99a4 commit 9875695
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 19 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/.bin/acorn
node_modules/
build/
build/
.DS_Store
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

## [1.0.1] - 2018-01-18
### Fixed
- You now stay logged in when you refresh the app after logging in

## [0.0.7] - 2018-01-18
### Added
- Map to measurement page.
Expand Down
28 changes: 14 additions & 14 deletions firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"headers": [
{
"key": "Link",
"value": "</bundle.80def.js>; rel=preload; as=script, </style.a240d.css>; rel=preload; as=style"
"value": "</bundle.f7598.js>; rel=preload; as=script, </style.02afd.css>; rel=preload; as=style"
}
]
},
Expand All @@ -51,61 +51,61 @@
"headers": [
{
"key": "Link",
"value": "</bundle.80def.js>; rel=preload; as=script, </style.a240d.css>; rel=preload; as=style, </route-account.chunk.14754.js>; rel=preload; as=script"
"value": "</bundle.f7598.js>; rel=preload; as=script, </style.02afd.css>; rel=preload; as=style, </route-account.chunk.f77b6.js>; rel=preload; as=script"
}
]
},
{
"source": "/addMedia",
"source": "/measurement",
"headers": [
{
"key": "Link",
"value": "</bundle.80def.js>; rel=preload; as=script, </style.a240d.css>; rel=preload; as=style, </route-addMedia.chunk.0993d.js>; rel=preload; as=script"
"value": "</bundle.f7598.js>; rel=preload; as=script, </style.02afd.css>; rel=preload; as=style, </route-measurement.chunk.d31ca.js>; rel=preload; as=script"
}
]
},
{
"source": "/overview",
"source": "/addMedia",
"headers": [
{
"key": "Link",
"value": "</bundle.80def.js>; rel=preload; as=script, </style.a240d.css>; rel=preload; as=style, </route-overview.chunk.ac036.js>; rel=preload; as=script"
"value": "</bundle.f7598.js>; rel=preload; as=script, </style.02afd.css>; rel=preload; as=style, </route-addMedia.chunk.0993d.js>; rel=preload; as=script"
}
]
},
{
"source": "/login",
"source": "/overview",
"headers": [
{
"key": "Link",
"value": "</bundle.80def.js>; rel=preload; as=script, </style.a240d.css>; rel=preload; as=style, </route-login.chunk.b8935.js>; rel=preload; as=script"
"value": "</bundle.f7598.js>; rel=preload; as=script, </style.02afd.css>; rel=preload; as=style, </route-overview.chunk.ac036.js>; rel=preload; as=script"
}
]
},
{
"source": "/add",
"source": "/Media",
"headers": [
{
"key": "Link",
"value": "</bundle.80def.js>; rel=preload; as=script, </style.a240d.css>; rel=preload; as=style, </route-add.chunk.d9d39.js>; rel=preload; as=script"
"value": "</bundle.f7598.js>; rel=preload; as=script, </style.02afd.css>; rel=preload; as=style, </route-Media.chunk.fcf75.js>; rel=preload; as=script"
}
]
},
{
"source": "/measurement",
"source": "/login",
"headers": [
{
"key": "Link",
"value": "</bundle.80def.js>; rel=preload; as=script, </style.a240d.css>; rel=preload; as=style, </route-measurement.chunk.b0abb.js>; rel=preload; as=script"
"value": "</bundle.f7598.js>; rel=preload; as=script, </style.02afd.css>; rel=preload; as=style, </route-login.chunk.b8935.js>; rel=preload; as=script"
}
]
},
{
"source": "/Media",
"source": "/add",
"headers": [
{
"key": "Link",
"value": "</bundle.80def.js>; rel=preload; as=script, </style.a240d.css>; rel=preload; as=style, </route-Media.chunk.53605.js>; rel=preload; as=script"
"value": "</bundle.f7598.js>; rel=preload; as=script, </style.02afd.css>; rel=preload; as=style, </route-add.chunk.d9d39.js>; rel=preload; as=script"
}
]
}
Expand Down
29 changes: 25 additions & 4 deletions src/components/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,21 @@ export default class App extends Component {
this.authenticate = this.authenticate.bind(this);

this.state = {
uid: 'hl8tgg53mkQIUmIh6D8SUsReTGD2',
email: '[email protected]',
// email: null,
// uid: null,
// uid: 'hl8tgg53mkQIUmIh6D8SUsReTGD2',
// email: '[email protected]',
email: null,
uid: null,
};
}

componentDidMount() {
firebase.auth(fireApp).onAuthStateChanged((user) => {
if (user) {
this.authHandler(null, { user });
}
});
}

logout(e) {
e.preventDefault();
firebase.auth(fireApp).signOut();
Expand All @@ -45,6 +53,19 @@ export default class App extends Component {
});
}

authHandler(err, authData) {
console.log(authData);
if (err) {
console.error(err);
return;
}

this.setState({
uid: authData.user.uid,
email: authData.user.email,
});
}

handleRoute = e => {
this.currentUrl = e.url;
};
Expand Down
4 changes: 4 additions & 0 deletions src/components/removeButton/style.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
.remove {
background: none;
border: 0;
border-radius: 0;
color: var(--main-color);
float: right;
font-size: 16px;
font-weight: 700;
margin-top: 10px;
outline: 0;
padding: 0;
text-align: right;
text-transform: uppercase;
Expand Down

0 comments on commit 9875695

Please sign in to comment.