mirror of
https://github.com/gosticks/web.git
synced 2026-12-03 17:51:39 +00:00
Add a loggedIn boolean to the api object
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
This commit is contained in:
@@ -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 }),
|
||||
|
||||
@@ -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 }));
|
||||
|
||||
Reference in New Issue
Block a user