Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export function postLoginDetails(username, password, token) {
- const url = ENV.host + "/login";
- return axios({
- method: 'post',
- url: url,
- withCredentials: true,
- headers: {
- "X-CSRFToken": token
- },
- data: {
- username: username,
- password: password,
- },
- responseType: 'json'
- }).catch(e => console.log(e))
- }
- postLoginDetails(username, password, this.token).then((res) => {
- if (res.data.success) {
- this.isAuthenticated.set(true)
- cb();
- } else {
- this.error.set(true);
- this.errorText = observable('Fehler aufgetreten');
- this.name = observable('');
- }
- this.loginLoading.set(false);
- })
Add Comment
Please, Sign In to add comment