Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.ajax({
- url: 'https://ec-portal-backend.herokuapp.com/o/token/',
- type: 'POST',
- data: {
- client_id: '',
- client_secret: '',
- grant_type: 'password',
- username: $('#username').val(),
- password: $('#password').val()
- },
- success: function (tokendata) {
- window.localStorage.setItem('company', logindata["company"]["id"]);
- window.localStorage.setItem('token', tokendata['access_token']);
- window.localStorage.setItem('refresh', tokendata['refresh_token']);
- window.location = "/";
- },
- error: function (error) {
- console.log(error);
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement