Guest User

Untitled

a guest
Dec 18th, 2017
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. static getToken(params) {
  2. const cookies = new Cookies()
  3. return axios.post(backendDomen + '/api/oauth/token', {
  4. client_id: clientId,
  5. client_secret: secret,
  6. grant_type: 'password',
  7. username: params.email,
  8. password: params.password,
  9. scope: '*'
  10. })
  11. .then(function (result) {
  12. if (result.data.access_token) {
  13. cookies.set('token', result.data.access_token, { path: '/' })
  14. window.location.replace('/brokers/customers/list')
  15. }
  16. }).catch(function (reason) {
  17. return reason.response
  18. })
  19. }
Add Comment
Please, Sign In to add comment