Add a loggedIn boolean to the api object

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
This commit is contained in:
Mcat12
2018-04-30 00:38:41 -04:00
parent e7ecb9e4fc
commit bcc4e854c9
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -67,6 +67,7 @@ export const ignoreCancel = err => {
};
export const api = {
loggedIn: false,
authenticate(key) {
return fetch(api.urlFor("auth"), {
headers: new Headers({ "X-Pi-hole-Authenticate": key }),
+1
View File
@@ -37,6 +37,7 @@ export default class Login extends Component {
// Assume it's ok since there was no error
// TODO: verify response
// TODO: transition to logged in mode
api.loggedIn = true;
console.log("Logged In");
})
.catch(() => this.setState({ error: true }));