First attempt at getting a prototype up
This commit is contained in:
1 parent
d0e63d5b9c
commit
10488ed6ba
40 files changed
+4673
-88
No files matched your search
Vendored
+33
@@ -0,0 +1,33 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var axios_1 = require("axios");
|
||||
var authHeaderKeys = [
|
||||
'access-token',
|
||||
'token-type',
|
||||
'client',
|
||||
'expiry',
|
||||
'uid',
|
||||
];
|
||||
exports.setAuthHeaders = function (headers) {
|
||||
authHeaderKeys.forEach(function (key) {
|
||||
axios_1.default.defaults.headers.common[key] = headers[key];
|
||||
});
|
||||
};
|
||||
// Will have to take a parameter from the package user to determine if this is for a browser or for React Native:
|
||||
exports.persistAuthHeadersInLocalStorage = function (headers) {
|
||||
authHeaderKeys.forEach(function (key) {
|
||||
localStorage.setItem(key, headers[key]);
|
||||
});
|
||||
};
|
||||
exports.deleteAuthHeaders = function () {
|
||||
authHeaderKeys.forEach(function (key) {
|
||||
delete axios_1.default.defaults.headers.common[key];
|
||||
});
|
||||
};
|
||||
// Will have to take a parameter from the package user to determine if this is for a browser or for React Native:
|
||||
exports.deleteAuthHeadersFromLocalStorage = function () {
|
||||
authHeaderKeys.forEach(function (key) {
|
||||
localStorage.removeItem(key);
|
||||
});
|
||||
};
|
||||
//# sourceMappingURL=auth.js.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/services/auth.ts"],"names":[],"mappings":";;AAAA,+BAAyB;AAGzB,IAAM,cAAc,GAAkB;IACpC,cAAc;IACd,YAAY;IACZ,QAAQ;IACR,QAAQ;IACR,KAAK;CACN,CAAA;AAEY,QAAA,cAAc,GAAG,UAAC,OAAoB;IACjD,cAAc,CAAC,OAAO,CAAC,UAAC,GAAW;QACjC,eAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAA;IACnD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,iHAAiH;AACpG,QAAA,gCAAgC,GAAG,UAAC,OAAoB;IACnE,cAAc,CAAC,OAAO,CAAC,UAAC,GAAW;QACjC,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA;IACzC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAEY,QAAA,iBAAiB,GAAG;IAC/B,cAAc,CAAC,OAAO,CAAC,UAAC,GAAW;QACjC,OAAO,eAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAC3C,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,iHAAiH;AACpG,QAAA,iCAAiC,GAAG;IAC/C,cAAc,CAAC,OAAO,CAAC,UAAC,GAAW;QACjC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;IAC9B,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA"}
|
||||
Reference in new issue
Block a user