This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/.cache/babel-loader/972f021fc3917c0300d100958707d223.json
2019-08-11 20:48:02 +02:00

1 line
No EOL
3.1 KiB
JSON

{"remainingRequest":"/home/soeren/dev/keksaccountgui/node_modules/babel-loader/lib/index.js!/home/soeren/dev/keksaccountgui/node_modules/eslint-loader/index.js??ref--13-0!/home/soeren/dev/keksaccountgui/src/services/User.js","dependencies":[{"path":"/home/soeren/dev/keksaccountgui/src/services/User.js","mtime":1564132781990},{"path":"/home/soeren/dev/keksaccountgui/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/home/soeren/dev/keksaccountgui/node_modules/babel-loader/lib/index.js","mtime":499162500000},{"path":"/home/soeren/dev/keksaccountgui/node_modules/eslint-loader/index.js","mtime":499162500000}],"contextDependencies":[],"result":["import Api from '@/services/Api';\nexport default {\n login: function login(username, password) {\n return Api().post('/v1/user/login', {\n username: username,\n password: password\n });\n },\n setAccessToken: function setAccessToken(access_token) {\n localStorage.setItem('access_token', access_token);\n Api().defaults.headers.common['Authorization'] = \"Bearer \".concat(access_token);\n },\n getTokenFromStorage: function getTokenFromStorage() {\n this.setAccessToken(localStorage.getItem(\"access_token\"));\n },\n me: function me() {\n return Api().get('/v1/user/me');\n },\n logout: function logout() {\n localStorage.removeItem(\"access_token\");\n },\n getMails: function getMails() {\n return Api().get('/v1/user/me/mails');\n }\n};",{"version":3,"sources":["/home/soeren/dev/keksaccountgui/src/services/User.js"],"names":["Api","login","username","password","post","setAccessToken","access_token","localStorage","setItem","defaults","headers","common","getTokenFromStorage","getItem","me","get","logout","removeItem","getMails"],"mappings":"AAAA,OAAOA,GAAP,MAAgB,gBAAhB;AAEA,eAAe;AACXC,EAAAA,KADW,iBACLC,QADK,EACKC,QADL,EACe;AACtB,WAAOH,GAAG,GAAGI,IAAN,CAAW,gBAAX,EAA6B;AAACF,MAAAA,QAAQ,EAAEA,QAAX;AAAqBC,MAAAA,QAAQ,EAAEA;AAA/B,KAA7B,CAAP;AACH,GAHU;AAKXE,EAAAA,cALW,0BAKIC,YALJ,EAKkB;AACzBC,IAAAA,YAAY,CAACC,OAAb,CAAqB,cAArB,EAAqCF,YAArC;AACAN,IAAAA,GAAG,GAAGS,QAAN,CAAeC,OAAf,CAAuBC,MAAvB,CAA8B,eAA9B,qBAA2DL,YAA3D;AACH,GARU;AASXM,EAAAA,mBATW,iCASW;AAClB,SAAKP,cAAL,CAAoBE,YAAY,CAACM,OAAb,CAAqB,cAArB,CAApB;AACH,GAXU;AAYXC,EAAAA,EAZW,gBAYN;AACD,WAAOd,GAAG,GAAGe,GAAN,CAAU,aAAV,CAAP;AACH,GAdU;AAeXC,EAAAA,MAfW,oBAeF;AACLT,IAAAA,YAAY,CAACU,UAAb,CAAwB,cAAxB;AACH,GAjBU;AAkBXC,EAAAA,QAlBW,sBAkBA;AACP,WAAOlB,GAAG,GAAGe,GAAN,CAAU,mBAAV,CAAP;AACH;AApBU,CAAf","sourcesContent":["import Api from '@/services/Api'\n\nexport default {\n login(username, password) {\n return Api().post('/v1/user/login', {username: username, password: password});\n },\n\n setAccessToken(access_token) {\n localStorage.setItem('access_token', access_token)\n Api().defaults.headers.common['Authorization'] = `Bearer ${access_token}`\n },\n getTokenFromStorage() {\n this.setAccessToken(localStorage.getItem(\"access_token\"));\n },\n me() {\n return Api().get('/v1/user/me')\n },\n logout() {\n localStorage.removeItem(\"access_token\");\n },\n getMails() {\n return Api().get('/v1/user/me/mails');\n }\n}"]}]}