load videopath from backend
correctly redirect to login page if login fails
This commit is contained in:
parent
f7705aef98
commit
da07dc04bd
@ -64,7 +64,8 @@ export namespace token {
|
|||||||
|
|
||||||
console.log(APiHost);
|
console.log(APiHost);
|
||||||
|
|
||||||
fetch(APiHost + 'token', {method: 'POST', body: formData}).then((response) =>
|
fetch(APiHost + 'token', {method: 'POST', body: formData})
|
||||||
|
.then((response) =>
|
||||||
response.json().then((result: APIToken) => {
|
response.json().then((result: APIToken) => {
|
||||||
if (result.error) {
|
if (result.error) {
|
||||||
callFuncQue(result.error);
|
callFuncQue(result.error);
|
||||||
@ -79,7 +80,10 @@ export namespace token {
|
|||||||
// call all handlers and release flag
|
// call all handlers and release flag
|
||||||
callFuncQue('');
|
callFuncQue('');
|
||||||
})
|
})
|
||||||
);
|
)
|
||||||
|
.catch((e) => {
|
||||||
|
callback(e);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function apiTokenValid(): boolean {
|
export function apiTokenValid(): boolean {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user