Advertisement
Guest User

Untitled

a guest
Sep 28th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. login = () => {
  2. return axios({
  3. method: 'post',
  4. url: `https://${this.login.credentials.apiUrl}/restful/u/login`,
  5. headers: {
  6. 'Content-Type': 'application/json',
  7. },
  8. data: {
  9. username: this.login.credentials.user,
  10. password: this.login.credentials.password
  11. },
  12. withCredentials: true,
  13. })
  14. };
  15.  
  16. logout = () => {
  17. return axios({
  18. method: 'post',
  19. url: `https://${this.login.credentials.apiUrl}/restful/u/logout`,
  20. headers: Object.assign(
  21. {},
  22. this.login.requestHeaders, // CSRF-token
  23. {'Content-Type': 'application/json'}
  24. ),
  25. withCredentials: true
  26. })
  27. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement