{"_id":"@aegis-auth/jwt","_rev":"37-6093a62bd56d89a107e03d4458e189c6","name":"@aegis-auth/jwt","dist-tags":{"latest":"17.0.0","ng8":"8.2.0","ng9":"9.2.0","ng10":"10.2.2","ng11":"11.1.0","ng12":"12.0.0","ng13":"13.0.0","ng14":"14.0.0","ng15":"15.0.1","ng16":"16.0.1","ng17":"17.0.0"},"versions":{"0.0.1":{"name":"@aegis-auth/jwt","version":"0.0.1","peerDependencies":{"@angular/common":"^9.1.9","@angular/core":"^9.1.9","rxjs":"~6.5.5"},"dependencies":{"tslib":"^1.10.0","js-base64":"^2.5.2"},"main":"bundles/aegis-auth-jwt.umd.js","module":"fesm5/aegis-auth-jwt.js","es2015":"fesm2015/aegis-auth-jwt.js","esm5":"esm5/aegis-auth-jwt.js","esm2015":"esm2015/aegis-auth-jwt.js","fesm5":"fesm5/aegis-auth-jwt.js","fesm2015":"fesm2015/aegis-auth-jwt.js","typings":"aegis-auth-jwt.d.ts","metadata":"aegis-auth-jwt.metadata.json","sideEffects":false,"_id":"@aegis-auth/jwt@0.0.1","_nodeVersion":"14.3.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-ViMWWaUGtXQouQ7JXd5NxL8tEcrGuphX0a7OCJZCL099KKcyaBGwHdLUte6lMQTfu6rKoEwzez5+jcLB25IpUA==","shasum":"e751963653d7c8501b8dcb00e76472c9dd6e0422","tarball":"https://registry.npmjs.org/@aegis-auth/jwt/-/jwt-0.0.1.tgz","fileCount":162,"unpackedSize":1148269,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe5p/sCRA9TVsSAnZWagAA8JUP/1/0moGKquhh2lCnEbI5\nLrerztY7ztjg0gzXfAdbe3aAdraoq3ZDShXz44GftmluvJKse+yTgKWR3TuI\nGutzCwmXB7WLB8KioZsOwygr5UezSWCX2ecwiuiapYS874n3qj8p2AqqGvA4\nuC57a7Pw8klIscHjKbkSKJoPtu8tpdQz4DVvaR5zcQMCsq3cCFvBTGIxQpYO\nQVY/MCJ3vkUjgg1ZVH1XKheUMuyWywxl4T833tkbQOk3HhbzsM6QzTLBK217\nJPSAKk5JjanMmXyEtWXWqxus/9wG8EW+1imwWFUAosdLEzcWHKo8BrQeQHeN\nB1ddYiUgvptYSOcaNveo5vk6gISF2HtdXoXAMJzSDCkiQfGH+CvkHdUM9gdD\nz9oUUW4DANILP42FEGqk4g0okR6WFz4Uw0mzcyLxWU1fW8sX/PMZS9r1mYyY\n2TOXvzUrluUI6udpKe/X/l2I6HjNjxypfqhE2VTtc19tMaMGU9xL2jX/ok+W\n81xNDJBQ8cDK3e315YNWj/n3c8LXQO21lsPsV9qa4gsFnLxCe0qrhlliiq/r\neXvNrtBxspSiBaLwzM+/xUKAHBntSps+ukbAc6yw1kX0uWkoK7P9sPkqHTpB\nYtgykbs8VVb91Lau8vJTVH3anukjlbMH/qbeo6KwdhToKsBRrt/bhQmVwjwp\nin1K\r\n=GwEs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHgJqwE0C6ouUhVDiwKRaWllFFJQ0JiNoYvhPB9wTQZUAiEA8JCmBNJGyUG1HlLb8fpBiUMCV7UpUlGRx1nxuzvvoDM="}]},"maintainers":[{"name":"alexaegis","email":"alexaegis@gmail.com"}],"_npmUser":{"name":"alexaegis","email":"alexaegis@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jwt_0.0.1_1592172524197_0.8764885933814588"},"_hasShrinkwrap":false},"0.1.1":{"name":"@aegis-auth/jwt","version":"0.1.1","peerDependencies":{"@angular/common":"^9.1.9","@angular/core":"^9.1.9","rxjs":"~6.5.5"},"dependencies":{"tslib":"^1.10.0","js-base64":"^2.5.2"},"main":"bundles/aegis-auth-jwt.umd.js","module":"fesm5/aegis-auth-jwt.js","es2015":"fesm2015/aegis-auth-jwt.js","esm5":"esm5/aegis-auth-jwt.js","esm2015":"esm2015/aegis-auth-jwt.js","fesm5":"fesm5/aegis-auth-jwt.js","fesm2015":"fesm2015/aegis-auth-jwt.js","typings":"aegis-auth-jwt.d.ts","metadata":"aegis-auth-jwt.metadata.json","sideEffects":false,"_id":"@aegis-auth/jwt@0.1.1","_nodeVersion":"12.18.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-P0XsxCeSHGRZYWrkeu6r3a7HALXvabhAnMk6vE5nJPZO0KNJwkWF3SO22wWdi8B72SjWRwE/KKeotNQEk6eOvA==","shasum":"b0296fcc7b3b49d115a2d3807df9a28132adcca2","tarball":"https://registry.npmjs.org/@aegis-auth/jwt/-/jwt-0.1.1.tgz","fileCount":161,"unpackedSize":363269,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe5snvCRA9TVsSAnZWagAAbQ8P/AuNKnKMbDHAZw7WxwIm\n+aeDMelrV+4Qq/fOyGczCFzyy8+ElKTnKmT784BXClFLTzZoCtHcYq02EZOk\nEGUz7ipROSKiaG4RaDkjhVQd/jBp2ukTvsktFytgJe/EhJOpiuchQOpFyfPZ\n29ioFD98z0e3kyCiSqsuuMlSCv9msSQc6QCgxUKH5U36ztgmKAyeA1Gmxaok\ntqZHJv9DdjE5K1+Q6T34Qt6P7Odmw0ynST5pbXuZXx+Dl0ph/jX+VfRFJ/48\naQxudUpUic04QdKndAKP6KYmG+XcV7PBVzNBYYvh5GSodLRyH2JBDscAzGQU\nUoz9B97ogJAUcw+43LrtJfWRNU9seoJNe7g+Q35+spMJjimfJcYSwgQjXzoz\n1grlU2Yp/gim+dtNK0WQe0E9mp7JQ1LtM82QC96aAzMO6MO6yvegyY3CshdE\nbVBL9OPyY2Zix/t+whYCpuIGUJE6xgTdJfPwGEHWsNvzdqmuy/b2Ad5/XEja\nlGreQGXPQHRVsxoqepGs6ggbv+xA58cruv19uz9QaAu+/CSfgyhhix0UAsF/\nculNzQeoAr6XgLPYfXVyabEZChiVi1LonNA33kl81l7Y7zdnAHRNGfEsjB0Y\nFuOquqTWZio5kpIzYTm8/Qm69dl7pFNjbAgbtPujnYREI3UIM9/gwpHHWUcn\nfPcI\r\n=/msm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEqu6Mtv8NKP+1SZeXD8/LNmRuF8wWauydeqwDLSvUCOAiBBkXhUngL7SgBn9kvm6jGXj6N5hpFpra17DvZxzVTHFg=="}]},"maintainers":[{"name":"alexaegis","email":"alexaegis@gmail.com"}],"_npmUser":{"name":"alexaegis","email":"alexaegis@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jwt_0.1.1_1592183279081_0.6373969809801683"},"_hasShrinkwrap":false},"0.1.2":{"name":"@aegis-auth/jwt","version":"0.1.2","peerDependencies":{"@angular/common":"^9.1.9","@angular/core":"^9.1.9","rxjs":"~6.5.5"},"dependencies":{"tslib":"^1.10.0","js-base64":"^2.5.2"},"main":"bundles/aegis-auth-jwt.umd.js","module":"fesm5/aegis-auth-jwt.js","es2015":"fesm2015/aegis-auth-jwt.js","esm5":"esm5/aegis-auth-jwt.js","esm2015":"esm2015/aegis-auth-jwt.js","fesm5":"fesm5/aegis-auth-jwt.js","fesm2015":"fesm2015/aegis-auth-jwt.js","typings":"aegis-auth-jwt.d.ts","metadata":"aegis-auth-jwt.metadata.json","sideEffects":false,"description":"This library was generated with [Nx](https://nx.dev).","_id":"@aegis-auth/jwt@0.1.2","_nodeVersion":"12.18.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Mg1c6Cicu57LGU07MOhxKEt9kCwE0ryXyA4sY5UoJJ3Z/SN1d88kghEwtxiVEGC77tnh/zlwh9D9SGnPh1jxCQ==","shasum":"c38733837880db9792a170dd9a8e886e54d51ca9","tarball":"https://registry.npmjs.org/@aegis-auth/jwt/-/jwt-0.1.2.tgz","fileCount":162,"unpackedSize":363406,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6zeoCRA9TVsSAnZWagAAZtgQAKS/WfkPzclkDRMN48t7\nj7lPJxRcYBd4IKtL2Z7VlIGv9I7ug07CKpW5OGKsc3sheUuNlIoPiAb6t6xI\nOmbLe+FfVrkS9wtE5OkEgCexRziEKfpLziqBX98oO6sbR6LKicRaKTe3lEiX\nnXaDD4kbDAQWOURR8PdHjhjVx1L3rf4JlIdsma0iowZK6YtOV4WHMwAtgRPo\ntYh7/kCGRVRaXnmEIuxKA+sbfNL4x4V7+Ws67ntWVkU8wBN3dyR4BmU0jrKC\nNaxF+bwTx9ZKPoO5yPljugKSdEa9ORhjW2s5E43L3WaY2ccu1kK583xgAlvP\nbXm9Q4zLPFtXMwQnWujajqfbM59QBYVjm03MyV9VzRJ6i2g2CFkA09AcATIv\n/jW0lz/SpT4FNyBDtud3kuBlX4xb35zweBhRaUt3x8wW5CAWqiJLAT0L+kcx\n1DfnCOXFHRWXvmC/ABnRaNtNsPJnlrRqILqQcbgaVGDJBePZW70GfLuf1sJF\nzF+a2o1F89KrrUYS+eQ3z2Va4cJ2DXIEiKQ7KIMt7Lu0bWyE8HfCkOFs2Tk6\n34KFq4shaIaYboT/84hAqtrC/5XJWOe8wumkV1fzBAmwfQmEXN2e5HEuSVXo\ndhJb4UdA8cGjbWXH12G2lHQ+ctEXcJCnCq4wZ0UwGVBnEd3pUSa54yNywual\nfujG\r\n=TfN/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFdIj79UrcS9TJtvHtI+X7zEzSuXVP8U1Gqv2sBwa66XAiEAk/W3dN4JmrjxkoSElGIinDyV+c8D+261dTQQ7lsKYKU="}]},"maintainers":[{"name":"alexaegis","email":"alexaegis@gmail.com"}],"_npmUser":{"name":"alexaegis","email":"alexaegis@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jwt_0.1.2_1592473511874_0.3117927881885787"},"_hasShrinkwrap":false},"0.1.3":{"name":"@aegis-auth/jwt","version":"0.1.3","peerDependencies":{"@angular/common":"^9.1.9","@angular/core":"^9.1.9","rxjs":"~6.5.5"},"dependencies":{"tslib":"^1.10.0","js-base64":"^2.6.1"},"main":"bundles/aegis-auth-jwt.umd.js","module":"fesm5/aegis-auth-jwt.js","es2015":"fesm2015/aegis-auth-jwt.js","esm5":"esm5/aegis-auth-jwt.js","esm2015":"esm2015/aegis-auth-jwt.js","fesm5":"fesm5/aegis-auth-jwt.js","fesm2015":"fesm2015/aegis-auth-jwt.js","typings":"aegis-auth-jwt.d.ts","metadata":"aegis-auth-jwt.metadata.json","sideEffects":false,"description":"This library was generated with [Nx](https://nx.dev).","_id":"@aegis-auth/jwt@0.1.3","_nodeVersion":"12.18.1","_npmVersion":"6.14.5","dist":{"integrity":"sha512-I3uXqQS5KtuBe+SGae08Hg4qdAmogax3eH990sXnbYGfE9RPnAC5Fou5Wv5U/bZ6xa+IMOzoYshO3ikEMqm88Q==","shasum":"f2aab84477eee535061874d0a9a7165e4ba480b4","tarball":"https://registry.npmjs.org/@aegis-auth/jwt/-/jwt-0.1.3.tgz","fileCount":192,"unpackedSize":551535,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+v+OCRA9TVsSAnZWagAABjAQAI9wjr09YsGkWQef20vO\nTnHBON84dJ20JTg9ZjNQ55FTjcBuqiGWYrzyyqO5ouxTB763ityx16YhInY6\npZ1tiLnp0UdM1mK1Pr6vMSZEH+65KvptDwfRWCkmQ3QHVqWgyhE1EiW/7YeA\n3qVrriJW6fG0BL0aTkS0UA9JQ3xb5pYGBt3Y+TpLm0g3TWMLPilffPPWXHmY\nnBGQQtYbsQ9Z/GubhomHlTOqzqTWyu+rY5OEqgw8AxCjBqERzW1m5rnd2cM2\nSP6LeByYSJyYS76EnSnSfBwtihDNL4IpNJBx4gj7AQlNH0KVH9E7MZgjvOvl\nzjR9Qj+RDqq2N+nppRl67xVh4KkJISX8gA6DVPvZe3IX+yoT8U3t9KKwzti3\n6lCsNeuhKjcYX+KiqNGnIXMCAxtTOgqo3ufpNGF8dC3QshuNflMYS+ppibcU\nH2fHbWLClvO5BqheBDabGvMbVlYGRyBTHY++IK0IeSGK4PkyY/rdQygsRqz2\nZ0f1ey5+gRd8/Ahs8lxB5RGgcC7pwKGSNb4fEHukshC7Jackf2aXvIOnFVlq\n8xw8cErP7SkJ2R1GhIxkDIHJkC4oFiB/vWMFyFoTRNpbaKhSyynX85vgpe10\n0ss+j500wyw5iR3JFJvSty+c2pXZC5/2PknRFEjxRLqZbCgkeAOrifwHn678\nuEtU\r\n=BWux\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEId8gvK2JDECnaSAPKE0NR8PjT4swML5KqjFaqSjAuLAiEA2HpQlFHlQgsG2BMs1vYGY/nDql+lOyY3/kwUXjQX/eQ="}]},"maintainers":[{"name":"alexaegis","email":"alexaegis@gmail.com"}],"_npmUser":{"name":"alexaegis","email":"alexaegis@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jwt_0.1.3_1593507725853_0.1660025233462068"},"_hasShrinkwrap":false},"0.1.4":{"name":"@aegis-auth/jwt","version":"0.1.4","peerDependencies":{"@angular/common":"^9.1.9","@angular/core":"^9.1.9","rxjs":"~6.5.5"},"dependencies":{"js-base64":"^2.6.1","tslib":"^2.0.1"},"main":"bundles/aegis-auth-jwt.umd.js","module":"fesm2015/aegis-auth-jwt.js","es2015":"fesm2015/aegis-auth-jwt.js","esm2015":"esm2015/aegis-auth-jwt.js","fesm2015":"fesm2015/aegis-auth-jwt.js","typings":"aegis-auth-jwt.d.ts","metadata":"aegis-auth-jwt.metadata.json","sideEffects":false,"description":"This library was generated with [Nx](https://nx.dev).","_id":"@aegis-auth/jwt@0.1.4","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-6FNhmsUM8jAhWn0/bpZf91LO832EyIpd4TA7N8TucKa8LioRXx+y74ExCmRwIFIoYAtuEPN0kU8gsB1y6hqQuQ==","shasum":"faa964c2153da0474f9e6cb7107e111b4ecd45c9","tarball":"https://registry.npmjs.org/@aegis-auth/jwt/-/jwt-0.1.4.tgz","fileCount":137,"unpackedSize":393443,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPsFZCRA9TVsSAnZWagAAUpkP/0r4Ou7rMG3l1IX6TtGo\nx1c0eZbzaUDAzGzcFlPXiUzeZUUbv1qcb2sBwHRjx5UtR5QpPF+TGG33gJtG\n88YGikGeH/rSpvf2zHVNY8C/FHlMN5KV0xhvUOdEe0i4fdXWDMdTZ3+wHp2G\nvRM8esUS1dahxad0qnKKhXXp2Ydueg25+zhnr4RgdJ2lC6ENihnzKeGYZd+c\nNoCns0Q4mYGlzt5nfNfj6L9M02qdfOZnu2qRyykUc/Cfr2N6pWpvWE7l3Ylt\nM4QlXI6Rnt6SIT5HESzd8dsw1GMfe9waByTzzNqZgzltIZ9MeUjgtfhZEqrp\nYSJEVzX6SFWFbVLo+rcuSgPcoN95C+Os2IA1kfrcwJrnad9+YY4V7SzxCtV2\nRHB3f0nz/gidaOZWUTvtCsFo/RkfKisqiMn0KZNlUAboqkvkDtoAsItW8Rv4\nzDhGCX8VZ4pSK/6XoeER+mA6DfwNKrSAiLAxxIMG+FUsGKEIb/XgpSP+qLph\nlBxOlmM8jfQTPo3IDE/rxNGuknu7ROesXa4j2Dc2ByAO5GvCsCp+xrv2m9mh\nogwDSxy8HXqUua7wJCmhGPhPjCaL4HXm9K5B7J0SEJ4CuMHvEkbqqt6qmE8w\nzZdIgbHO6dVbk5OJF7ApEczdvwt26FNXZt5FgKcl0dLJdqzA3Winmp5rG66J\nZAjD\r\n=MaGd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC717hTytrtqlbIYwxYD0oLCu227WcXZ/gcjxKFI4rd3wIhAKn2XAHCr1mEzm+ACPlbF8fZyNS3bmxdKgl4JXZaRgXS"}]},"maintainers":[{"name":"alexaegis","email":"alexaegis@gmail.com"}],"_npmUser":{"name":"alexaegis","email":"alexaegis@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jwt_0.1.4_1597948247849_0.9317482432221966"},"_hasShrinkwrap":false},"1.0.0":{"name":"@aegis-auth/jwt","version":"1.0.0","peerDependencies":{"@angular/common":"^9.1.9","@angular/core":"^9.1.9","rxjs":"~6.5.5"},"dependencies":{"js-base64":"^3.4.5","tslib":"^2.0.1","@angular/router":"^9.1.9"},"optionalDependencies":{"@angular/router":"^9.1.9"},"main":"bundles/aegis-auth-jwt.umd.js","module":"fesm2015/aegis-auth-jwt.js","es2015":"fesm2015/aegis-auth-jwt.js","esm2015":"esm2015/aegis-auth-jwt.js","fesm2015":"fesm2015/aegis-auth-jwt.js","typings":"aegis-auth-jwt.d.ts","metadata":"aegis-auth-jwt.metadata.json","sideEffects":false,"description":"This package handles common JWT handling, like adding the access token to requests **and automatically refreshing it when needed**.","_id":"@aegis-auth/jwt@1.0.0","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-GbFp8BTzYSdVHmd2dMns23zvSBFcBXKAF/HRi/DrwAhbhO+YGMnIJ9gNGBPE/Vp1XgXe3G2QwsP2hIbC2nmIXw==","shasum":"b5ec98ef38f444566e64b84d90dfd32cfa251727","tarball":"https://registry.npmjs.org/@aegis-auth/jwt/-/jwt-1.0.0.tgz","fileCount":160,"unpackedSize":545300,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTEXICRA9TVsSAnZWagAAVv0QAJYohkXCf7xWmjtve08q\nvRIiiX0m4UMtOqQw+5W+NAjraECgfCvpM8CWzSWvLeW2ir/zsDrDvTTg9bRb\nkWhnTbbw+rqaV6nYpH0SKuRwR1VPJ+EimTto3DFVEU3lgEoSSL7BcyKXiqSk\nLl/DIag5LxhWRfXaOZJpr1djEigYY7fRiNUKPcm/riiLr4gvT2gLmyX53FSH\ns7qFS78Vh5dQsNtjJ0zZ3JOa6yKot+J4XKPJjUpDAwXkzLOYTcWovK0CQ9Ny\nlkLE/9DlCYAP3AZj0TKKms0EPM1oibH4H33KLaCTOlRrEmiwugtaSETFdnVj\nv9YE8e/KXCxBgtuZuOrkdYzMOLA+nrtYx4FNrxxBMw5vW8YFpV9z01Cvu7EJ\nwG83hMjEUxnhuOKY0opPuLpjxtUULNesLmU2EyqKOqlhbtIRabn/FRQqOJiy\ndtnSCMsce/LxSFZeUpDKWIDtn8JiQFu91waKQa90ehl/Ae3Ep9cx2mTWx3/z\n4SajGoqfcYRBMHw1QIckDZhMqJxrs2FXpT/K+mngcnbbJ4UB8B5s/VPgP2Sj\nP7eZIAKODpMKZP/w2SjHu+dyjIvnA4YAP+ve1bVVR5UiYitRQ4ViIH7M0dL4\nyG456YRuGQHU7LFhnFgwzpI4T37A+/UT8jAbzaD5oUdtEJvMfWsqVeMUTCyZ\nRrQs\r\n=PtzX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHP6Xf+TalWdl/hKbLO577x99zSjRbwoKCKAexixZYxtAiEA1ZyYerTJ9qAMGtZSwRsaFG5VDyayR8QNhkm8OWIz/mQ="}]},"maintainers":[{"name":"alexaegis","email":"alexaegis@gmail.com"}],"_npmUser":{"name":"alexaegis","email":"alexaegis@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jwt_1.0.0_1598834119943_0.4098490483670787"},"_hasShrinkwrap":false},"1.0.1":{"name":"@aegis-auth/jwt","version":"1.0.1","peerDependencies":{"@angular/common":"^9.1.9","@angular/core":"^9.1.9","rxjs":"~6.5.5"},"dependencies":{"js-base64":"^3.4.5","tslib":"^2.0.1","@angular/router":"^9.1.9"},"optionalDependencies":{"@angular/router":"^9.1.9"},"main":"bundles/aegis-auth-jwt.umd.js","module":"fesm2015/aegis-auth-jwt.js","es2015":"fesm2015/aegis-auth-jwt.js","esm2015":"esm2015/aegis-auth-jwt.js","fesm2015":"fesm2015/aegis-auth-jwt.js","typings":"aegis-auth-jwt.d.ts","metadata":"aegis-auth-jwt.metadata.json","sideEffects":false,"description":"> gzipped cost ~9.39kb","_id":"@aegis-auth/jwt@1.0.1","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-zpTepuR2QqnjVCYp8XhO+oj3YyLTCP0f/Xyajo+DlOTeUg+AEUFN6YWupqafNTPljtn/Kt+DdBmLTecSZk0IbA==","shasum":"9f14c55511e8502179040784b21d575749f98e9f","tarball":"https://registry.npmjs.org/@aegis-auth/jwt/-/jwt-1.0.1.tgz","fileCount":128,"unpackedSize":556048,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTtjqCRA9TVsSAnZWagAAy78P/2dCvPO6Z1AKO93Nmj6/\nhkUSSDwF+tBnm8iV8zH4MyhBIQ6qABwXX8a2lLdwbNAIjvBC+p5MKSWlA9aA\noB5OkgtDgDsTtuGVV7ZamBmdCbA1KRml19DbOTQDVJE+vSni9Zuq2IirsZlH\nizC+9a6pGZ0998fFIgRYvLoabTqotStJEle9M7bg9eHwsUkp+YxIJ3o3YPMy\nVN0FBFvisjif0vqRKepZlXLUebjjNqd5L0r9Ez7liCfuJ4PTQ6ebl5uosL++\nLNSnwXwLF+cqLMsFIEdZJNlp5vZfMP/abJbEBqsU9GMwqYSSfu9Vbkb9Iu0D\nyY33CrdYR8EjSjMd1uDUq3OR95zWri8G7aPzr1LTCTq9zerVdS9BTIZ/04BH\nHjlfUKc18lHN2wKcAsOZDuFFuq93Sh0dEPJUEzn8UJmaynqkZnQpKZNb96SH\nkmgyARhfSotJn3TFcjlgp+s/ouECEk8OVlw45v8NwY1N8hxZTGsIDPHhafm8\n0hxQgAbugVZ/Akrdl97xnj3tX0iq5yY0PUv+IEov/Kb1M98MdqIV8ZtKC9LB\nvTG9AlHbqnHRoAyxNKBv9vIAtQNy5arFk+6whm8pboD9ukA1AVw4B0+8G+K0\nqz40tnCPtoRBJPuXehsM2RrfDdM9wfT04Dj1cA/G2bV/T4P06wWj6aM/qDqU\nZF2B\r\n=XZ0d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC9ZQobPzWzogYcwjkiL3XAHMl4g+aLJCECdVSHIDPeAQIgcK87mOFbNBnEyD4bs4Dx7gp/tsscK93xs5O/DMJd88A="}]},"maintainers":[{"name":"alexaegis","email":"alexaegis@gmail.com"}],"_npmUser":{"name":"alexaegis","email":"alexaegis@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jwt_1.0.1_1599002858045_0.2182220649281985"},"_hasShrinkwrap":false},"8.0.0":{"name":"@aegis-auth/jwt","version":"8.0.0","peerDependencies":{"@angular/common":"8.*.*","@angular/core":"8.*.*","@angular/router":"8.*.*","rxjs":"6.4.*"},"dependencies":{"js-base64":"^3.4.5","tslib":"1.9.*"},"main":"bundles/aegis-auth-jwt.umd.js","module":"fesm2015/aegis-auth-jwt.js","es2015":"fesm2015/aegis-auth-jwt.js","esm2015":"esm2015/aegis-auth-jwt.js","fesm2015":"fesm2015/aegis-auth-jwt.js","typings":"aegis-auth-jwt.d.ts","metadata":"aegis-auth-jwt.metadata.json","sideEffects":false,"description":"Handles common JWT use-cases, like adding the access token to requests **and automatically refreshing it when needed**.","_id":"@aegis-auth/jwt@8.0.0","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-okLMGsPRFodjUejEmVNyBY71WnaWx5qi/bftyV/XppWlzwPoBEDsFCnYi2Z9mCkgqH+2BktJqpC6Xj1JHutuOw==","shasum":"2972cb65b1419527ab1a9cee88fb102af71ced0e","tarball":"https://registry.npmjs.org/@aegis-auth/jwt/-/jwt-8.0.0.tgz","fileCount":128,"unpackedSize":551921,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUT6OCRA9TVsSAnZWagAAQVUP/AwaoUWOz57oTYXuk7q7\nQr1BsNHZaxpOVpM3Bx7/CFA/yS0hyxYmbv2YFtGPTTt8TnE6kYTxipQhsiw/\n5t0+EwBMqzkgrqd8AjlARXxk27cG3YiM7WYqamCwWOrIjMtnA/jADZCzeWid\nyxb2vzdCzAcN9v/r5Zj4tOL73BPw5z971QENIBim5SyQCvih9s3r7qbxoSKG\ni+kvHrB3oeoCyr85ZNE9MBHWl052+iutY9v3hOobmYNPFh5uTJaR/MKzIP5b\n0HovTefqRvGsKs1mnLQM/wMwfveji+Psq3VdtHaAE/MitM+mWYYrdH8A4jcE\nbc/O0RrsDkSOqAeyLnX1bV90Hikp7zabItt0tofOila+PI7oaqEokTHkYFbs\nxRpbR69Wr03r9EuSjWAr7Thl00WvwB0reVR3gwKmGlPB9YkRwn2KXgz6yB5Q\nd3oWb7JPeTpIdsywf4hPSXMZEYiuYxCtbtXNlwwQzKYDVQahCRQ86fZoXLOv\nyTEI4ovafN3rBOk0W8NA6K0IV3E1VEygHz6wXL1crb58RBIDFwIYPrZqntpt\n9Pwt8bQDh7jwy/39Rjk+70aYBYTkV0zqHwG5+HXYk5NYdkL5oDOS7mU6VYAp\nqLz4LGKjnZ8IBudREDC4Kiw3+zUZXuNQceVf5ewZl4alRJph9kK+eAiGYzkh\n+k/Z\r\n=GKsP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDNkhg6+X3RbFNDrX7G9EF1QQZBwRbEsO3CpwE/5o9SHgIhAIQIKxe50QyPfImdS5t5h+cC57IrOwlN/zwBI+XAIROm"}]},"maintainers":[{"name":"alexaegis","email":"alexaegis@gmail.com"}],"_npmUser":{"name":"alexaegis","email":"alexaegis@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jwt_8.0.0_1599159949962_0.5053447286661819"},"_hasShrinkwrap":false},"9.0.0":{"name":"@aegis-auth/jwt","version":"9.0.0","peerDependencies":{"@angular/common":"9.*.*","@angular/core":"9.*.*","@angular/router":"9.*.*","rxjs":"6.5.*"},"dependencies":{"js-base64":"^3.4.5","tslib":"1.10.*"},"main":"bundles/aegis-auth-jwt.umd.js","module":"fesm2015/aegis-auth-jwt.js","es2015":"fesm2015/aegis-auth-jwt.js","esm2015":"esm2015/aegis-auth-jwt.js","fesm2015":"fesm2015/aegis-auth-jwt.js","typings":"aegis-auth-jwt.d.ts","metadata":"aegis-auth-jwt.metadata.json","sideEffects":false,"description":"Handles common JWT use-cases, like adding the access token to requests **and automatically refreshing it when needed**.","_id":"@aegis-auth/jwt@9.0.0","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-Mz0CoH9ySvsl2ZQHCWAPL3MajyzWtqxOlz7jrH4zP+6vB/f1hdpBK9PCaefgHBY/MozqYRrKsOuU8tDX7da5bQ==","shasum":"5d5fedf340a048c42263994ef165190715e7d318","tarball":"https://registry.npmjs.org/@aegis-auth/jwt/-/jwt-9.0.0.tgz","fileCount":128,"unpackedSize":552550,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUVBjCRA9TVsSAnZWagAAZwQP/iuaqyntpvaB7tCFogrf\ncPCB1+Mq5jWCKYr+1hJ/wJ1Jj/ccBNwl5vm5EL4yt6RIfUNi50Syt+9JbzuP\nGLAXK4xduYqV/hRCjzCnMpogT51i4yVafUX/XYNOwdKZaNB0vsW43A7lBAKU\ncFrSgvhK/NkARJm3a0Q9SBLJk7jRdDunrWdYBXQItZK9q5PEAPJue4y8Ggzk\n1oG13ZbIbxPprz1CQ3z9K3d2xG/5+8cXihpVXjjz0qNAv3j66E5RQJeB8RMB\nGrtRrIeoT8Q3MYfSgsrgupMIDiR9uQODueMyUCPJQ/45ZZ+YEl9QbqNzCZgd\nACB79jLJuT3AzJ6AQDrOcigDk0BguwpTq6pBlPF2hD+e2ynAzuTqgbZgeWL/\nARQIK+bImmCZe82aOmyBoMTsmY0TvlFXO0cUslgNoyd6YRW2mpkgOzyevfFS\nH0NxVwRp9Qg9inK8KtupJB6SXpXtnKoQdbgfArV2wIliAZcojzj5dsB4Sd3X\nPKZyP6kp8SKLT/CqjzRhcrc2oLAk6fNL7T+0Qs2D65zAHbYAlQiIbF/GwGUh\nsZ7V9TU6GzF7mpy4wJv0dPJfmaW+QZH/k0vjmAMqOwzvaiANmCDFwifcj7Lc\nYsAQvoRnH8pY1amYzW79VkEy5rMhV0OyyVAEt8yijf2JPLMGW4OjQjbe59oJ\nJIp8\r\n=Vprq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGoRRokyASFLtqxmZF2Amh4hlD6Q0ThRu8oASPrQ7S35AiEAkU0qphvUEoWorUq9yET2gGshMr8nzoY8xq5menIZi1g="}]},"maintainers":[{"name":"alexaegis","email":"alexaegis@gmail.com"}],"_npmUser":{"name":"alexaegis","email":"alexaegis@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jwt_9.0.0_1599164515111_0.2182210626594323"},"_hasShrinkwrap":false},"10.0.0":{"name":"@aegis-auth/jwt","version":"10.0.0","peerDependencies":{"@angular/common":"10.*.*","@angular/core":"10.*.*","@angular/router":"10.*.*","rxjs":"6.6.*"},"dependencies":{"js-base64":"^3.4.5","tslib":"2.*.*"},"main":"bundles/aegis-auth-jwt.umd.js","module":"fesm2015/aegis-auth-jwt.js","es2015":"fesm2015/aegis-auth-jwt.js","esm2015":"esm2015/aegis-auth-jwt.js","fesm2015":"fesm2015/aegis-auth-jwt.js","typings":"aegis-auth-jwt.d.ts","metadata":"aegis-auth-jwt.metadata.json","sideEffects":false,"description":"Handles common JWT use-cases, like adding the access token to requests **and automatically refreshing it when needed**.","_id":"@aegis-auth/jwt@10.0.0","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-UNSoAR2fQ58PK1ELcupMzuU87+aQoliK945tLHZda1qh/aiIf+7T3Kxa48w+Une1DnqjzzBQOOvoOXMQDgr6kg==","shasum":"a335fd2dec5ab676b6ac34933b3e84be5c3d2d82","tarball":"https://registry.npmjs.org/@aegis-auth/jwt/-/jwt-10.0.0.tgz","fileCount":128,"unpackedSize":556173,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUVXjCRA9TVsSAnZWagAAGzAQAJZk5jgeXo4lYBFqx1mS\nZpoc6WVPhdDMviy41+EGUtNpTiuKrhDTxvtOqU8R5gR0BGZA9l1pbyU8KP8D\nIsgE1ixky4D2y1okQ6iAkK33YXXkVkD+UuzpZO0Mx7MDGpkul95uDKYZoIcB\nJGfdwglv4xIJYFqgpJw3VJpIhNKZUz5+Mrj/nPn7yOdLTrgzNB9ltDJt1JsA\nytZbT2uWG2VfQ63WWPumj1cIerva0JPDdIe7qDzhQbiZB94rFrIdow6bavEt\ncK9+RaFMVoIoC8QAFBNGaV9ykPfH1oxnZ4OBAEUXJs9pYjEI5ZB1K7BM+1Fd\n20oxLuU1vdkTz0Slkt4VqDxM7b3eGtd+K+odkgNwTYGm67ZQk3Ty+ftm1L1a\nhQhH+y5qUGxltANr21ITIAAENDyfvXm/EqQBEHlwPTgDBnJ/Uaa07zq2ozG7\nL5E232FsFgpx2nnZt16iTcXnhq59x+gNFPY5og/W65gx6S4ql8+j2C2I/f2b\naYHd5l7II70/AMuGYTijqbfe46ig2nr1OS/i+hlR1QQgg0snj12dIydzsrnr\nlYU5POLfmnRI+rbgev/Zn4V0+Hjgi96n2gxPrtXTKJS+UM1ZDJLtCOB/CcKE\n10KHp4B1SXRgRVd1HSGNI1w3y6ErdiVLeLYWJxQyba9pvDMHVyQuevLeDjuT\nVAEZ\r\n=QJ97\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICxIcIE9vVs8QnEk6GJBUQAoXJ6XdfXMlBrcbK1iYY//AiEAxZ00QgBnIj+fwYNdYs7E9Q6ZXiAT/Oon82HJjI5E4GI="}]},"maintainers":[{"name":"alexaegis","email":"alexaegis@gmail.com"}],"_npmUser":{"name":"alexaegis","email":"alexaegis@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jwt_10.0.0_1599165923183_0.6265173301080607"},"_hasShrinkwrap":false},"10.1.0":{"name":"@aegis-auth/jwt","version":"10.1.0","peerDependencies":{"@angular/common":"10.*.*","@angular/core":"10.*.*","@angular/router":"10.*.*","rxjs":"6.6.*"},"dependencies":{"js-base64":"^3.4.5","tslib":"2.*.*"},"main":"bundles/aegis-auth-jwt.umd.js","module":"fesm2015/aegis-auth-jwt.js","es2015":"fesm2015/aegis-auth-jwt.js","esm2015":"esm2015/aegis-auth-jwt.js","fesm2015":"fesm2015/aegis-auth-jwt.js","typings":"aegis-auth-jwt.d.ts","metadata":"aegis-auth-jwt.metadata.json","sideEffects":false,"description":"<!-- markdownlint-disable MD013 -->","_id":"@aegis-auth/jwt@10.1.0","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-7RpWWGbCBH/8+V62sjz9EloekrDPyxwB5OGBAUksF0z8B2cYa/5cpAGjKeQZy4KLxgIn+I4BQfkOBvFJ3NT4qQ==","shasum":"69aa4307222ee8e6ac3dcf43dc5e0d73be3bf6c6","tarball":"https://registry.npmjs.org/@aegis-auth/jwt/-/jwt-10.1.0.tgz","fileCount":141,"unpackedSize":614194,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVO2aCRA9TVsSAnZWagAANesP/10YETk+pmrEir8j4LFU\nyO0IM03oQTe6Jg88cmYxeIZkVlRZhopRWW8l641LPSMRTObNlla+tQNNYGvS\nHOSLEuA22CB0zGS/KX+ZkALqojisfyOCSqfWIR+vAsNUkKLpRywm3DbiXAQY\n5p5QkoLbsTkYoc15jW9vlkyJ+XmJ0W3E0ttfm99tASlTAC99YI2ZpAPKO5gn\nbPVa7L/mXoHDr4NHaS5bXfUr575ArWiLMs+eUOp7YMYYX4qDgcsnXKypFMUg\n5K0oUIaGsnmBZFlf5Nzh6w0BPPoy2pMmQZvscrY6O2FXZerJwksnzi0FCvq5\nrqLne/7bWgAVvXHypWxIroln0QhZViMyWxCZMThy4MZHM+LC1TDBH9b/d9Xx\npIrR552KrFanfpmM9uxLeZeCZvryho83araebWFzT8AOdXmrkeomZnuINpsX\nfuLIZzQnYkpFdKB8JfQ7KWmevcRCKdTTTn9cUvyKUDvnDHfR2pQIHHHu4L6d\nXzxXu0qSKoMGUQJ4SM7Eo12snEIw5eTdRWhHp6vOV+ZOb3XcGYJbvc8R1Zm0\n2Z8pHqGR0NRG7z3Ik5kWMSlRG9LEg8x32117IuR6/fU5+0lsaT5U2QN6K/0P\no8d96k1AfqKRbdLA/KGh8r5BGPivdbR4aM/pW09hEmjh4kyj89luLVl/3/44\nPIAH\r\n=jniU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCm3X+6Cf9QHXstI+la0ZmjtOXsHkE+0Zu2bSgrrfgoKAIhAKtUm9FB/mTeFBlzAheTNPAWrSbB/+uK5sS8qr5HtHT1"}]},"maintainers":[{"name":"alexaegis","email":"alexaegis@gmail.com"}],"_npmUser":{"name":"alexaegis","email":"alexaegis@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jwt_10.1.0_1599401369911_0.48391344629949584"},"_hasShrinkwrap":false},"8.1.0":{"name":"@aegis-auth/jwt","version":"8.1.0","peerDependencies":{"@angular/common":"8.*.*","@angular/core":"8.*.*","@angular/router":"8.*.*","rxjs":"6.4.*"},"dependencies":{"js-base64":"^3.4.5","tslib":"1.9.*"},"main":"bundles/aegis-auth-jwt.umd.js","module":"fesm2015/aegis-auth-jwt.js","es2015":"fesm2015/aegis-auth-jwt.js","esm2015":"esm2015/aegis-auth-jwt.js","fesm2015":"fesm2015/aegis-auth-jwt.js","typings":"aegis-auth-jwt.d.ts","metadata":"aegis-auth-jwt.metadata.json","sideEffects":false,"readme":"# jwt\n\n<!-- markdownlint-disable MD013 -->\n\n[![NG8 NPM Version](https://img.shields.io/npm/v/@aegis-auth/jwt/ng8)](https://www.npmjs.com/package/@aegis-auth/jwt/v/ng9)\n\n<!-- markdownlint-enable MD013 -->\n\nHandles common JWT use-cases, like adding the access token to\nrequests **and automatically refreshing it when needed**.\n\nIt consists of a `JwtModule` with two configurable Interceptors, and a helper\nservice to access your parsed and typed tokens.\n\nIt also provides a way to handle cases where a refresh cannot happen\n(For example: both token expired) with a redirection (As thats the most\ncommon recovery method) or a completely custom function for more advanced\nuse-cases.\n\n## Installation\n\nUsing npm\n\n```sh\nnpm i @aegis-auth/jwt\n```\n\nUsing yarn\n\n```sh\nyarn add @aegis-auth/jwt\n```\n\n## Usage\n\nFor an example app visit the [jwt-demo](../../apps/jwt-demo) application.\nIt's small and simple.\n\n### Configuration\n\nThe heart of the library is the `JwtModule` and it's `forRoot` method which\nhelps you configure it's providers.\n\n#### Basic usage\n\nFor simple usecases, where you only want to have the access token injected\ninto your http headers, you only need to configure the first provider, like so.\n\n> The provider definitions in this project are typed! While configuring it\n> you will always have knowledge on what you can configure and how, right\n> there! There is JSDoc hint for each!\n\nThis is the simplest possible configuration, where you put your tokens into\nlocalstorage. Remember that the library will call **this `getToken`** function\nevery time it needs to use the token!\n\n```ts\nJwtModule.forRoot({\n  useValue: {\n    getToken: () => localStorage.getItem('accessToken'),\n  },\n});\n```\n\nI recommend using a `BehaviorSubject` in a service, so it can stay in memory,\nit still can be initialized from the `localStorage` and with a subscription\nyou can always save the changes.\n([Example](../../apps/jwt-demo/src/app/service/auth.service.ts))\n\nFor this, you would use a factory provider with this service as it's\ndependency:\n\n```ts\nJwtModule.forRoot({\n  useFactory: (authService: AuthService) => ({\n    getToken: authService.accessTokenStorage$,\n    domainWhitelist: ['localhost'],\n  }),\n  deps: [AuthService],\n});\n```\n\nConfiguring this provider causes an HTTP Interceptor to be activated. It will\nappend the acquired token in a configurable header on every request where it's\napplicable.\n\n##### Configuration options\n\n```ts\ninterface JwtConfiguration extends UrlFilter {\n  /**\n   * A callback or observable that will be called or subscribed to\n   * on every http request and returns a value for the header\n   *\n   * @example getValue: () => localstorage.get('foo')\n   * @example getValue: myTokenService.foo$\n   */\n  getToken:\n    | Observable<string | null | undefined>\n    | (() =>\n        | string\n        | null\n        | undefined\n        | Promise<string | null | undefined>\n        | Observable<string | null | undefined>);\n\n  /**\n   * The prefix of the token when injecting. Notice thet the trailing\n   * whitespace has to be set here\n   *\n   * @default 'Bearer '\n   */\n  scheme?: string;\n\n  /**\n   * Header name to be set\n   *\n   * @default 'Authorization'\n   */\n  header: string;\n\n  /**\n   * This callback is called when the request fails and there is no\n   * RefreshConfiguration, or when the access token is simply missing.\n   * `getToken` returned a nullish value. If the RefreshConfiguration is\n   * available, then the error handling continues in the same fashion on\n   * the other configuration.\n   *\n   * Both have the same names and signature for\n   * both the error handling configuration options `onFailure` and\n   * `onFailureRedirectParameters`, so if you wish to use the same for both\n   * implement them outside, and spread them back. You can use the\n   * `JwtErrorHandling` interface to help you with the typing. Although\n   * thats a bit wider when it comes to the error types.\n   *\n   * If it's a string, instead of calling it, a redirection will happen,\n   * with `onFailureRedirectParameters` as it's queryParams.\n   */\n  onFailure?: string | ((jwtError: JwtError) => void);\n\n  /**\n   * This option is only used when the `onFailure` option is a string\n   * so it's handled as a redirect. When this happens, you can define\n   * the queryparams to be used with this redirect.\n   */\n  onFailureRedirectParameters?:\n    | ((error: JwtError) => HttpParams | Params)\n    | HttpParams\n    | Params;\n}\n```\n\nThese properties are available on the configuration, and are used to control\nwhat Urls can or can not recieve the token\n\n```ts\ninterface UrlFilter {\n  /**\n   * These domains won't recieve this header even if they are listed in the\n   * whitelist.\n   *\n   * If `null` or `undefined`, this category of rules won't take any effect.\n   * If empty, it would mean \"No domains are blacklisted\", and it won't\n   * take any effect.\n   *\n   * @default undefined\n   * @example ['localhost:3333']\n   * @example [/localhost:[0-9]{4}/]\n   */\n  domainBlacklist?: (string | RegExp)[];\n\n  /**\n   * Only domains listed will be recieving header injections\n   *\n   * If `null` or `undefined`, this category of rules won't take any effect.\n   * If empty, it would mean \"No domains are whitelisted\", so no paths would\n   * recieve tokens!\n   *\n   * @default undefined\n   * @example ['localhost:3333']\n   * @example [/localhost:[0-9]{4}/]\n   */\n  domainWhitelist?: (string | RegExp)[];\n\n  /**\n   * These paths won't recieve this header even if they are listed in the\n   * whitelist.\n   *\n   * If `null` or `undefined`, this category of rules won't take any effect.\n   * If empty, it would mean \"No paths are blacklisted\", and it won't\n   * take any effect.\n   *\n   * @default undefined\n   * @example ['api/v2/users/1']\n   * @example [/users\\/.+/]\n   */\n  pathBlacklist?: (string | RegExp)[];\n\n  /**\n   * Only paths listed will be recieving this header injection.\n   *\n   * If `null` or `undefined`, this category of rules won't take any effect.\n   * If empty, it would mean \"No paths are whitelisted\", so no paths would\n   * recieve tokens!\n   *\n   * @default undefined\n   * @example ['api/v2/users/1']\n   * @example [/users\\/.+/]\n   */\n  pathWhitelist?: (string | RegExp)[];\n\n  /**\n   * These protocols won't recieve this header even if they are listed in\n   * the whitelist.\n   *\n   * If `null` or `undefined`, this category of rules won't take any effect.\n   * If empty, it would mean \"No protocols are blacklisted\", and it won't\n   * take any effect.\n   *\n   * @default undefined\n   * @example ['http']\n   * @example [/https?/]\n   */\n  protocolBlacklist?: (string | RegExp)[];\n\n  /**\n   * Only protocols listed will be recieving this header injections.\n   *\n   * If empty or undefined, this category of rules won't take any effect.\n   * If empty, it would mean \"No protocols are whitelisted\", so no protocols\n   * would recieve tokens!\n   *\n   * @default undefined\n   * @example ['http']\n   * @example [/https?/]\n   */\n  protocolWhitelist?: (string | RegExp)[];\n}\n```\n\n#### Refreshing usage\n\nYou can optionally configure a second provider. If you do, another HTTP\nInterceptor will make sure that if an endpoint that needs to recieve an\n`accessToken`, and the provided one is expired, it first visits the\nconfigured refresh endpoint, optionally refreshes your storage, and retries the\noriginally intended request with the newly acquired, fresh access token.\n\nIt can also do the same if the original token wasn't expired, but the server\nrejected it (For example, the server can have a blacklist mechanic on login).\nIt only retries once, and by default it only does the retry if the error\nstatus was `401`, Unauthorized.\n\n##### Refresh configuration options\n\nBecause handling refreshes is not standardized instead of asking for the\nrefresh token directly I ask you to provide the request itself, however you\nlike to. In these callbacks you can access your refreshToken wherever you\nstore it.\n\nThe reason it's configured through multiple properties instead of a callback\nwhere I let you do the refresh request however you see fit is to make sure the\nrefreshUrl is known to avoid potentional infinite requests when hitting the\nrefresh endpoint. This way you don't have to remember setting this into the\nurl filter manually.\n\n````ts\nexport interface JwtRefreshConfiguration<RefreshRequest, RefreshResponse>\n  extends UrlFilter,\n    HttpErrorFilter {\n  /**\n   * After a successful refresh, this callback will be called.\n   * You need to define a function which will save the the token in a way\n   * that if the interceptor calls `getToken` again, it will get the token\n   * saved with this method.\n   *\n   * @example using `localStorage`\n   *    setToken: (response) => localStorage.setItem('accessToken', response.accessToken)\n   * @example using a service.\n   *\n   * ```typescript\n   * AuthCoreModule.forRoot<TokenStorageService>({\n   *    useFactory: (service: TokenStorageService) => ({\n   *      getToken: service.accessToken$\n   *      autoRefresher: {\n   *         endpoint: `${environment.api}/auth/refresh`,\n   *         setRefreshToken: (response) => service.accessToken$.next(response.accessToken)\n   *       }\n   *    }),\n   *    deps: [TokenStorageService],\n   * })\n   * ```\n   *\n   */\n  setRefreshedTokens: (response: JwtRefreshResponse) => void;\n\n  /**\n   * The method for the request, usually it's a POST so that's the default\n   *\n   * @default 'POST'\n   */\n  method?: HttpMethodType;\n  /**\n   * The endpoint that will be requested for a new token\n   */\n  refreshUrl: string;\n  /**\n   * A callback that should return the body of the request\n   */\n  createRefreshRequestBody: () => RefreshRequest;\n  /**\n   * A callback that should return the defaults on the request\n   */\n  refreshRequestInitials?:\n    | (() => HttpRequestInit | undefined)\n    | HttpRequestInit;\n  /**\n   * This function have to transform the result of your refresh endpoint\n   * into a digestable form. It will be called after successful refreshes.\n   */\n  transformRefreshResponse: (response: RefreshResponse) => JwtRefreshResponse;\n\n  /**\n   * This callback is called when a refresh either failed or cannot be done.\n   * This marks the point where both tokens are invalid and the user needs to\n   * relog. Because this is usually done through a login page, aside from a\n   * regular callback, a string can also be supplied which will act as the\n   * target of navigation. Check `onFailureRedirectParameters` if you wish\n   * to supply query parameters. For more advanced usage, consider\n   * implementing it as a custom function, the error object is available\n   * there too!\n   */\n  onFailure?:\n    | string\n    | ((error: JwtCouldntRefreshError | JwtCannotRefreshError) => void);\n\n  onFailureRedirectParameters?:\n    | ((\n        error: JwtCouldntRefreshError | JwtCannotRefreshError\n      ) => HttpParams | Params)\n    | HttpParams\n    | Params;\n\n  /**\n   * Optional!\n   *\n   * Not used in the refresh mechanic! See `createRefreshRequestBody` if you\n   * need to provide the `refreshToken` in the body when making the refresh\n   * request or `refreshRequestInitials` when it's handled in a header!\n   *\n   * A callback or observable that can be used to retrieve the refresh token\n   * Not used in the interceptor! it is only used in the helper service if\n   * you with to interact with the parsed refreshToken throught the helper\n   * observables. If you do not, you don't have to implement this.\n   *\n   * @example getValue: () => localstorage.get('foo')\n   * @example getValue: myTokenService.foo$\n   */\n  getRefreshToken?:\n    | Observable<string | null | undefined>\n    | (() =>\n        | string\n        | null\n        | undefined\n        | Promise<string | null | undefined>\n        | Observable<string | null | undefined>);\n\n  /**\n   * When using the LoginGuard this setting will determine the default\n   * value. So instead of disabling the autoRefresh behavior on every\n   * route with the data option, or writing your own guard (Which would\n   * be really simple) just set this to false. You can still override it\n   * using route data.\n   *\n   * See the LoginGuardData helper interface to see what it can utilize.\n   *\n   * @default true\n   */\n  isAutoRefreshAllowedInLoginGuardByDefault?: boolean;\n}\n````\n\nAll options on the URLFilter are also available here too to further restrict\nwhat endpoint can be refreshed.\n\nAdditionally, it can filter on the return status of a failed request\n\n```ts\nexport interface HttpErrorFilter {\n  /**\n   * The error codes on which an act is allowed to happen,\n   * an empty array means it can't act on anything\n   *\n   * @default [401]\n   */\n  errorCodeWhitelist?: number[];\n\n  /**\n   * The error codes on which an act is not allowed to happen,\n   * an empty array (and if undefined) means it can always try a single\n   * act in case of an error\n   *\n   * @default undefined\n   */\n  errorCodeBlacklist?: number[];\n}\n```\n\n### The helper service\n\nThe provided\n[`JwtTokenService<Claims>`](./src/lib/service/jwt-token.service.ts) is a\nservice consisting of Observable pipelines all originating from the\ngetToken property in your configuration provided by you.\n\nThere are observables to acquire the raw tokens:\n\n- `rawAccessToken$: Observable<string | null | undefined>`\n- `rawRefreshToken$: Observable<string | null | undefined>`\n\nThe parsed tokens:\n\n- `accessToken$: Observable<JwtToken<Claims> | null>`\n- `refreshToken$: Observable<JwtToken<Claims> | null>`\n\nWhere `JwtToken<Claims>` is:\n\n```ts\nclass JwtToken<Claims extends {}> {\n  header: JwtTokenHeader, // Based on RFC 7519\n  payload: JwtTokenPayload & Claims, // Based on RFC 7519\n  signature: string,\n  isExpired: () => boolean\n}\n```\n\nThe headers:\n\n- `accessTokenHeader$: Observable<JwtTokenHeader | null>`\n- `refreshTokenHeader$: Observable<JwtTokenHeader | null>`\n\nThe payloads:\n\n- `accessTokenHeader$: Observable<(JwtTokenPayload & Claims) | null>`\n- `refreshTokenHeader$: Observable<(JwtTokenPayload & RefreshClaims) | null>`\n\nAnd if they are expired or not:\n\n- `isAccessTokenExpired$: Observable<boolean>`\n- `isRefreshTokenExpired$: Observable<boolean>`\n\nThe payload is used to carry custom claims. These can be defined by you and\npassed to the service on injection as a generic. Though often not used, the\nsecond generic allows to define the extra claims on the refresh token.\n\n```ts\nexport interface MyClaims {\n  username: string;\n}\n\nexport class MyService {\n  constructor(private readonly jwtTokenService: JwtTokenService<MyClaims>) {\n    this.jwtTokenService.accessToken$.pipe(\n      map((token) => token?.payload.username) // Here, `username` is a string\n    );\n  }\n}\n```\n\nRemember, that the helper service has to inject the configuration inside it,\nso if you would try to inject this service into any of the dependencies of the\nconfigurations provider of the JwtModule, you would get a cyclic dependency.\n\nBut since this helper servise does not contain any functions, you can't pass\nany more information to it. That means it can be used independently.\n\nIf you do need to use your original dependency and this helper service together\nI recommend making that original dependency into a simple storage with\n2 `BehaviorSubject`s, and making another service where you can inject both.\n\nIn the example application, the `AuthService` acts both as the storage of the\ntokens, and some methods on doing `login`, `refresh` and `logout`.\n\nThis demo `AuthService` only has to manage the token storage, the library\nwill always use the latest values.\n\n### The LoginGuard\n\nUsing the LoginGuard on a route means that the route and all of its children\ncannot open unless there is a valid accessToken available. Since tokens are\nonly refreshed on-demand it's possible that after an idle time that is longer\nthan the accessTokens lifetime, that on guard activation the token is expired.\n\nFor this reason, the guard does a `manualRefresh` if the token is invalid.\n\nThe autorefreshing is controllable with a configuration option on the refresh\nconfiguration and per route with route data. See `LoginGuardData` for what is\navailable.\n\n```ts\n/**\n * This interface is for your convinience to use with Route data to see what\n * you can configure on the LoginGuard\n */\nexport interface LoginGuardData {\n  /**\n   * Explicitly enable or disable auto refreshing on the route.\n   */\n  isRefreshAllowed: boolean;\n}\n```\n\nIf you need something more custom, I highly recommend implementing your own\nguard as `LoginGuard` itself is also really simple.\n","readmeFilename":"readme.md","description":"<!-- markdownlint-disable MD013 -->","_id":"@aegis-auth/jwt@8.1.0","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-k0hsizsOSNPkvw8UlWlF8pZKaSeA2fjlUEPdTEZahOiqhFXWzOcCNdhiVjZHjYrDH9rj4ug/bpLDGZQxZm8zbA==","shasum":"67660dcdd0d72628dfb2cd1fac1aefdfbec09d4d","tarball":"https://registry.npmjs.org/@aegis-auth/jwt/-/jwt-8.1.0.tgz","fileCount":141,"unpackedSize":612443,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVP1MCRA9TVsSAnZWagAAB0IP+gPySOajBmKHV0oEpXEd\nN3iMjSTIGVGxgUOedE7F9vj9L+97RzQssS7fmhKpOq4Abws8tf8grt/yDZ2V\nVszrbsqzwODvR6a3ucmdPoVDea7QT0j+/LQBOylvHVYEVuJSSq7D/b8bBtW9\nzD5oWkH510Lxzm6seDGeNhmLxq9nuok5x6Ou+IiXfmB5FI6AMIq3p7e3TfWp\nyphXDXeIlM5mV4ygANr/9JslevcM8Cd7e/lhKS/Au+SeRiucBrTsKPRRZOby\n209nA1pLL5YAwgkXlSMYGJ7Qi4qD6tKw8FNChJX1T52xQwv/J02YHQUNF9pj\nUzaTvodNWJRVwDR7Pcjs1DLcsZWNleubDgKBMvZwX609PJ7iLVzCPxocoKfW\nKj/UZh6gwoILMb3Q3mnRudDW7uwRNwVpEtVDAbIPR9w9c0FdRj3dRUbm5kvL\nuqOp+vx+Tz1eX7Kva/3NwVYLC3e+B6kGKNktguX+24bNUSaUSux3Hr4y5JtU\nEWq9rBu/M2Gkc9FnO4iABnTuT669aejx13143BtUqfes20AIduJOdhFNXy0c\nwe6ybpzrtacl+Ygg4v3M8rPAcQyqoLa7WDDqeUT8aH0bg/NszOibBNyqtIng\nb3PoK3fqzicDFnLnxphrqgJyeCu2i2swQKTZMBd8mmADlMOSZ0F+MIyQhazJ\nrUE2\r\n=y+tL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF2frrA319u+c4QVReWMp5JBz0itPj67378Mo6z/PfsEAiEAlWoQBXrHc+vCl/qtIZLz//j89BXkqnjDK8Nu+sNycsI="}]},"maintainers":[{"name":"alexaegis","email":"alexaegis@gmail.com"}],"_npmUser":{"name":"alexaegis","email":"alexaegis@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jwt_8.1.0_1599405387832_0.49154423329617614"},"_hasShrinkwrap":false},"9.1.0":{"name":"@aegis-auth/jwt","version":"9.1.0","peerDependencies":{"@angular/common":"9.*.*","@angular/core":"9.*.*","@angular/router":"9.*.*","rxjs":"6.5.*"},"dependencies":{"js-base64":"^3.4.5","tslib":"1.10.*"},"main":"bundles/aegis-auth-jwt.umd.js","module":"fesm2015/aegis-auth-jwt.js","es2015":"fesm2015/aegis-auth-jwt.js","esm2015":"esm2015/aegis-auth-jwt.js","fesm2015":"fesm2015/aegis-auth-jwt.js","typings":"aegis-auth-jwt.d.ts","metadata":"aegis-auth-jwt.metadata.json","sideEffects":false,"readme":"# jwt\n\n<!-- markdownlint-disable MD013 -->\n\n[![NG9 NPM Version](https://img.shields.io/npm/v/@aegis-auth/jwt/ng9)](https://www.npmjs.com/package/@aegis-auth/jwt/v/ng9)\n\n<!-- markdownlint-enable MD013 -->\n\nHandles common JWT use-cases, like adding the access token to\nrequests **and automatically refreshing it when needed**.\n\nIt consists of a `JwtModule` with two configurable Interceptors, and a helper\nservice to access your parsed and typed tokens.\n\nIt also provides a way to handle cases where a refresh cannot happen\n(For example: both token expired) with a redirection (As thats the most\ncommon recovery method) or a completely custom function for more advanced\nuse-cases.\n\n## Installation\n\nUsing npm\n\n```sh\nnpm i @aegis-auth/jwt\n```\n\nUsing yarn\n\n```sh\nyarn add @aegis-auth/jwt\n```\n\n## Usage\n\nFor an example app visit the [jwt-demo](../../apps/jwt-demo) application.\nIt's small and simple.\n\n### Configuration\n\nThe heart of the library is the `JwtModule` and it's `forRoot` method which\nhelps you configure it's providers.\n\n#### Basic usage\n\nFor simple usecases, where you only want to have the access token injected\ninto your http headers, you only need to configure the first provider, like so.\n\n> The provider definitions in this project are typed! While configuring it\n> you will always have knowledge on what you can configure and how, right\n> there! There is JSDoc hint for each!\n\nThis is the simplest possible configuration, where you put your tokens into\nlocalstorage. Remember that the library will call **this `getToken`** function\nevery time it needs to use the token!\n\n```ts\nJwtModule.forRoot({\n  useValue: {\n    getToken: () => localStorage.getItem('accessToken'),\n  },\n});\n```\n\nI recommend using a `BehaviorSubject` in a service, so it can stay in memory,\nit still can be initialized from the `localStorage` and with a subscription\nyou can always save the changes.\n([Example](../../apps/jwt-demo/src/app/service/auth.service.ts))\n\nFor this, you would use a factory provider with this service as it's\ndependency:\n\n```ts\nJwtModule.forRoot({\n  useFactory: (authService: AuthService) => ({\n    getToken: authService.accessTokenStorage$,\n    domainWhitelist: ['localhost'],\n  }),\n  deps: [AuthService],\n});\n```\n\nConfiguring this provider causes an HTTP Interceptor to be activated. It will\nappend the acquired token in a configurable header on every request where it's\napplicable.\n\n##### Configuration options\n\n```ts\ninterface JwtConfiguration extends UrlFilter {\n  /**\n   * A callback or observable that will be called or subscribed to\n   * on every http request and returns a value for the header\n   *\n   * @example getValue: () => localstorage.get('foo')\n   * @example getValue: myTokenService.foo$\n   */\n  getToken:\n    | Observable<string | null | undefined>\n    | (() =>\n        | string\n        | null\n        | undefined\n        | Promise<string | null | undefined>\n        | Observable<string | null | undefined>);\n\n  /**\n   * The prefix of the token when injecting. Notice thet the trailing\n   * whitespace has to be set here\n   *\n   * @default 'Bearer '\n   */\n  scheme?: string;\n\n  /**\n   * Header name to be set\n   *\n   * @default 'Authorization'\n   */\n  header: string;\n\n  /**\n   * This callback is called when the request fails and there is no\n   * RefreshConfiguration, or when the access token is simply missing.\n   * `getToken` returned a nullish value. If the RefreshConfiguration is\n   * available, then the error handling continues in the same fashion on\n   * the other configuration.\n   *\n   * Both have the same names and signature for\n   * both the error handling configuration options `onFailure` and\n   * `onFailureRedirectParameters`, so if you wish to use the same for both\n   * implement them outside, and spread them back. You can use the\n   * `JwtErrorHandling` interface to help you with the typing. Although\n   * thats a bit wider when it comes to the error types.\n   *\n   * If it's a string, instead of calling it, a redirection will happen,\n   * with `onFailureRedirectParameters` as it's queryParams.\n   */\n  onFailure?: string | ((jwtError: JwtError) => void);\n\n  /**\n   * This option is only used when the `onFailure` option is a string\n   * so it's handled as a redirect. When this happens, you can define\n   * the queryparams to be used with this redirect.\n   */\n  onFailureRedirectParameters?:\n    | ((error: JwtError) => HttpParams | Params)\n    | HttpParams\n    | Params;\n}\n```\n\nThese properties are available on the configuration, and are used to control\nwhat Urls can or can not recieve the token\n\n```ts\ninterface UrlFilter {\n  /**\n   * These domains won't recieve this header even if they are listed in the\n   * whitelist.\n   *\n   * If `null` or `undefined`, this category of rules won't take any effect.\n   * If empty, it would mean \"No domains are blacklisted\", and it won't\n   * take any effect.\n   *\n   * @default undefined\n   * @example ['localhost:3333']\n   * @example [/localhost:[0-9]{4}/]\n   */\n  domainBlacklist?: (string | RegExp)[];\n\n  /**\n   * Only domains listed will be recieving header injections\n   *\n   * If `null` or `undefined`, this category of rules won't take any effect.\n   * If empty, it would mean \"No domains are whitelisted\", so no paths would\n   * recieve tokens!\n   *\n   * @default undefined\n   * @example ['localhost:3333']\n   * @example [/localhost:[0-9]{4}/]\n   */\n  domainWhitelist?: (string | RegExp)[];\n\n  /**\n   * These paths won't recieve this header even if they are listed in the\n   * whitelist.\n   *\n   * If `null` or `undefined`, this category of rules won't take any effect.\n   * If empty, it would mean \"No paths are blacklisted\", and it won't\n   * take any effect.\n   *\n   * @default undefined\n   * @example ['api/v2/users/1']\n   * @example [/users\\/.+/]\n   */\n  pathBlacklist?: (string | RegExp)[];\n\n  /**\n   * Only paths listed will be recieving this header injection.\n   *\n   * If `null` or `undefined`, this category of rules won't take any effect.\n   * If empty, it would mean \"No paths are whitelisted\", so no paths would\n   * recieve tokens!\n   *\n   * @default undefined\n   * @example ['api/v2/users/1']\n   * @example [/users\\/.+/]\n   */\n  pathWhitelist?: (string | RegExp)[];\n\n  /**\n   * These protocols won't recieve this header even if they are listed in\n   * the whitelist.\n   *\n   * If `null` or `undefined`, this category of rules won't take any effect.\n   * If empty, it would mean \"No protocols are blacklisted\", and it won't\n   * take any effect.\n   *\n   * @default undefined\n   * @example ['http']\n   * @example [/https?/]\n   */\n  protocolBlacklist?: (string | RegExp)[];\n\n  /**\n   * Only protocols listed will be recieving this header injections.\n   *\n   * If empty or undefined, this category of rules won't take any effect.\n   * If empty, it would mean \"No protocols are whitelisted\", so no protocols\n   * would recieve tokens!\n   *\n   * @default undefined\n   * @example ['http']\n   * @example [/https?/]\n   */\n  protocolWhitelist?: (string | RegExp)[];\n}\n```\n\n#### Refreshing usage\n\nYou can optionally configure a second provider. If you do, another HTTP\nInterceptor will make sure that if an endpoint that needs to recieve an\n`accessToken`, and the provided one is expired, it first visits the\nconfigured refresh endpoint, optionally refreshes your storage, and retries the\noriginally intended request with the newly acquired, fresh access token.\n\nIt can also do the same if the original token wasn't expired, but the server\nrejected it (For example, the server can have a blacklist mechanic on login).\nIt only retries once, and by default it only does the retry if the error\nstatus was `401`, Unauthorized.\n\n##### Refresh configuration options\n\nBecause handling refreshes is not standardized instead of asking for the\nrefresh token directly I ask you to provide the request itself, however you\nlike to. In these callbacks you can access your refreshToken wherever you\nstore it.\n\nThe reason it's configured through multiple properties instead of a callback\nwhere I let you do the refresh request however you see fit is to make sure the\nrefreshUrl is known to avoid potentional infinite requests when hitting the\nrefresh endpoint. This way you don't have to remember setting this into the\nurl filter manually.\n\n````ts\nexport interface JwtRefreshConfiguration<RefreshRequest, RefreshResponse>\n  extends UrlFilter,\n    HttpErrorFilter {\n  /**\n   * After a successful refresh, this callback will be called.\n   * You need to define a function which will save the the token in a way\n   * that if the interceptor calls `getToken` again, it will get the token\n   * saved with this method.\n   *\n   * @example using `localStorage`\n   *    setToken: (response) => localStorage.setItem('accessToken', response.accessToken)\n   * @example using a service.\n   *\n   * ```typescript\n   * AuthCoreModule.forRoot<TokenStorageService>({\n   *    useFactory: (service: TokenStorageService) => ({\n   *      getToken: service.accessToken$\n   *      autoRefresher: {\n   *         endpoint: `${environment.api}/auth/refresh`,\n   *         setRefreshToken: (response) => service.accessToken$.next(response.accessToken)\n   *       }\n   *    }),\n   *    deps: [TokenStorageService],\n   * })\n   * ```\n   *\n   */\n  setRefreshedTokens: (response: JwtRefreshResponse) => void;\n\n  /**\n   * The method for the request, usually it's a POST so that's the default\n   *\n   * @default 'POST'\n   */\n  method?: HttpMethodType;\n  /**\n   * The endpoint that will be requested for a new token\n   */\n  refreshUrl: string;\n  /**\n   * A callback that should return the body of the request\n   */\n  createRefreshRequestBody: () => RefreshRequest;\n  /**\n   * A callback that should return the defaults on the request\n   */\n  refreshRequestInitials?:\n    | (() => HttpRequestInit | undefined)\n    | HttpRequestInit;\n  /**\n   * This function have to transform the result of your refresh endpoint\n   * into a digestable form. It will be called after successful refreshes.\n   */\n  transformRefreshResponse: (response: RefreshResponse) => JwtRefreshResponse;\n\n  /**\n   * This callback is called when a refresh either failed or cannot be done.\n   * This marks the point where both tokens are invalid and the user needs to\n   * relog. Because this is usually done through a login page, aside from a\n   * regular callback, a string can also be supplied which will act as the\n   * target of navigation. Check `onFailureRedirectParameters` if you wish\n   * to supply query parameters. For more advanced usage, consider\n   * implementing it as a custom function, the error object is available\n   * there too!\n   */\n  onFailure?:\n    | string\n    | ((error: JwtCouldntRefreshError | JwtCannotRefreshError) => void);\n\n  onFailureRedirectParameters?:\n    | ((\n        error: JwtCouldntRefreshError | JwtCannotRefreshError\n      ) => HttpParams | Params)\n    | HttpParams\n    | Params;\n\n  /**\n   * Optional!\n   *\n   * Not used in the refresh mechanic! See `createRefreshRequestBody` if you\n   * need to provide the `refreshToken` in the body when making the refresh\n   * request or `refreshRequestInitials` when it's handled in a header!\n   *\n   * A callback or observable that can be used to retrieve the refresh token\n   * Not used in the interceptor! it is only used in the helper service if\n   * you with to interact with the parsed refreshToken throught the helper\n   * observables. If you do not, you don't have to implement this.\n   *\n   * @example getValue: () => localstorage.get('foo')\n   * @example getValue: myTokenService.foo$\n   */\n  getRefreshToken?:\n    | Observable<string | null | undefined>\n    | (() =>\n        | string\n        | null\n        | undefined\n        | Promise<string | null | undefined>\n        | Observable<string | null | undefined>);\n\n  /**\n   * When using the LoginGuard this setting will determine the default\n   * value. So instead of disabling the autoRefresh behavior on every\n   * route with the data option, or writing your own guard (Which would\n   * be really simple) just set this to false. You can still override it\n   * using route data.\n   *\n   * See the LoginGuardData helper interface to see what it can utilize.\n   *\n   * @default true\n   */\n  isAutoRefreshAllowedInLoginGuardByDefault?: boolean;\n}\n````\n\nAll options on the URLFilter are also available here too to further restrict\nwhat endpoint can be refreshed.\n\nAdditionally, it can filter on the return status of a failed request\n\n```ts\nexport interface HttpErrorFilter {\n  /**\n   * The error codes on which an act is allowed to happen,\n   * an empty array means it can't act on anything\n   *\n   * @default [401]\n   */\n  errorCodeWhitelist?: number[];\n\n  /**\n   * The error codes on which an act is not allowed to happen,\n   * an empty array (and if undefined) means it can always try a single\n   * act in case of an error\n   *\n   * @default undefined\n   */\n  errorCodeBlacklist?: number[];\n}\n```\n\n### The helper service\n\nThe provided\n[`JwtTokenService<Claims>`](./src/lib/service/jwt-token.service.ts) is a\nservice consisting of Observable pipelines all originating from the\ngetToken property in your configuration provided by you.\n\nThere are observables to acquire the raw tokens:\n\n- `rawAccessToken$: Observable<string | null | undefined>`\n- `rawRefreshToken$: Observable<string | null | undefined>`\n\nThe parsed tokens:\n\n- `accessToken$: Observable<JwtToken<Claims> | null>`\n- `refreshToken$: Observable<JwtToken<Claims> | null>`\n\nWhere `JwtToken<Claims>` is:\n\n```ts\nclass JwtToken<Claims extends {}> {\n  header: JwtTokenHeader, // Based on RFC 7519\n  payload: JwtTokenPayload & Claims, // Based on RFC 7519\n  signature: string,\n  isExpired: () => boolean\n}\n```\n\nThe headers:\n\n- `accessTokenHeader$: Observable<JwtTokenHeader | null>`\n- `refreshTokenHeader$: Observable<JwtTokenHeader | null>`\n\nThe payloads:\n\n- `accessTokenHeader$: Observable<(JwtTokenPayload & Claims) | null>`\n- `refreshTokenHeader$: Observable<(JwtTokenPayload & RefreshClaims) | null>`\n\nAnd if they are expired or not:\n\n- `isAccessTokenExpired$: Observable<boolean>`\n- `isRefreshTokenExpired$: Observable<boolean>`\n\nThe payload is used to carry custom claims. These can be defined by you and\npassed to the service on injection as a generic. Though often not used, the\nsecond generic allows to define the extra claims on the refresh token.\n\n```ts\nexport interface MyClaims {\n  username: string;\n}\n\nexport class MyService {\n  constructor(private readonly jwtTokenService: JwtTokenService<MyClaims>) {\n    this.jwtTokenService.accessToken$.pipe(\n      map((token) => token?.payload.username) // Here, `username` is a string\n    );\n  }\n}\n```\n\nRemember, that the helper service has to inject the configuration inside it,\nso if you would try to inject this service into any of the dependencies of the\nconfigurations provider of the JwtModule, you would get a cyclic dependency.\n\nBut since this helper servise does not contain any functions, you can't pass\nany more information to it. That means it can be used independently.\n\nIf you do need to use your original dependency and this helper service together\nI recommend making that original dependency into a simple storage with\n2 `BehaviorSubject`s, and making another service where you can inject both.\n\nIn the example application, the `AuthService` acts both as the storage of the\ntokens, and some methods on doing `login`, `refresh` and `logout`.\n\nThis demo `AuthService` only has to manage the token storage, the library\nwill always use the latest values.\n\n### The LoginGuard\n\nUsing the LoginGuard on a route means that the route and all of its children\ncannot open unless there is a valid accessToken available. Since tokens are\nonly refreshed on-demand it's possible that after an idle time that is longer\nthan the accessTokens lifetime, that on guard activation the token is expired.\n\nFor this reason, the guard does a `manualRefresh` if the token is invalid.\n\nThe autorefreshing is controllable with a configuration option on the refresh\nconfiguration and per route with route data. See `LoginGuardData` for what is\navailable.\n\n```ts\n/**\n * This interface is for your convinience to use with Route data to see what\n * you can configure on the LoginGuard\n */\nexport interface LoginGuardData {\n  /**\n   * Explicitly enable or disable auto refreshing on the route.\n   */\n  isRefreshAllowed: boolean;\n}\n```\n\nIf you need something more custom, I highly recommend implementing your own\nguard as `LoginGuard` itself is also really simple.\n","readmeFilename":"readme.md","description":"<!-- markdownlint-disable MD013 -->","_id":"@aegis-auth/jwt@9.1.0","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-VYqtPXxv9ikt61yzez1N/gh4+mpodfKVoeuYopmOVhjELxlk6NtQ98yRnRW75jkT4fC9JlRlPVk1nBJo/mWuqg==","shasum":"76e3b31e1c8b549914e7504cc8864bcb9722a2e6","tarball":"https://registry.npmjs.org/@aegis-auth/jwt/-/jwt-9.1.0.tgz","fileCount":141,"unpackedSize":612810,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVP8ACRA9TVsSAnZWagAAtegP/0GOJT0iuESe+jjDLO+m\nRUXEP2QesA2UVAKubnOSdR2yONAEijWQc6TNY6NvvbNP+NTj6wzfQkTMCJJP\nUh7rtqorm4Q6NBanznmbl8Z0IzOBbFdXWGFuZ1nwYe6qGOEDcrAHhAOOk/x6\ne6m48xW0BGf8AUtSEPP+pw5jS6vNTw9FwJl3/qrPK3L3db94Nmeg4KjVm7RU\nIB1lhVGJsyUwGzhhVajZBWpvtTB587q0tmA/L7yt2+qkw7SNlNJCdY7A3iZT\n03TIrpHYbZgXnw7ZzJ2qFqbk+ZKgoCcVTnpAJ02SJI2M5vg4mJwGyKLAfQtD\nyQsZi6RikQ9NGDpFIEWztGGCGNCm4JsdpC7u8V2S3BRLcXlK59tI22nBHinN\nMcA0iVCJJ6CCrWpKVuEQQXDkDkHsPOsbTEYsrdejjq0VW4Fb88eK5aA9M6a4\nflaeNL792hC5tmjlPDMMxBo5oLDmUV82gLvk69yEVbBDGigKxRjQ5BAI8QKU\nuQraBhGcbMnaMmbdirUTtf5hlFyDmqO7832g3JgyEAXUNLtGc0ZuxuKPyxDp\namqCO2zvubtErPrSi4nlMi4iDmm2B3rJvpj78z6oGrXULcAk54UKWpjgnoNn\nVQc2JW/0JehsuWtz4h3Ytod+i4J5BxBEnt7dYEcjQPBkY5RU9RTR7pvemipn\naKOE\r\n=90du\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC+CYEu/eGYn4C/emYU8E9R8IBgTA80i9R+hOu5tw3g9wIhAJd4dOoX9tRDBLDlp6s+DggDSa5NkprBcP+JkXOw3zKD"}]},"maintainers":[{"name":"alexaegis","email":"alexaegis@gmail.com"}],"_npmUser":{"name":"alexaegis","email":"alexaegis@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jwt_9.1.0_1599405824420_0.9445021880624658"},"_hasShrinkwrap":false},"10.2.0":{"name":"@aegis-auth/jwt","description":"Angular JWT authentication library","version":"10.2.0","license":"MIT","author":{"name":"AlexAegis","email":"alexaegis@gmail.com","url":"https://www.github.com/AlexAegis"},"homepage":"https://github.com/AlexAegis/auth/tree/master/libs/jwt#readme","repository":{"type":"git","url":"git+https://github.com/AlexAegis/auth.git"},"bugs":{"url":"https://www.github.com/AlexAegis/auth/issues"},"keywords":["ng","angular","jwt","token","auth","authentication","rxjs","reactive","interceptor","ts","typescript","js","javascript"],"peerDependencies":{"@angular/common":"10.*.*","@angular/core":"10.*.*","@angular/router":"10.*.*","rxjs":"6.6.*"},"dependencies":{"js-base64":"^3.5.2","tslib":"2.*.*"},"main":"bundles/aegis-auth-jwt.umd.js","module":"fesm2015/aegis-auth-jwt.js","es2015":"fesm2015/aegis-auth-jwt.js","esm2015":"esm2015/aegis-auth-jwt.js","fesm2015":"fesm2015/aegis-auth-jwt.js","typings":"aegis-auth-jwt.d.ts","metadata":"aegis-auth-jwt.metadata.json","sideEffects":false,"_id":"@aegis-auth/jwt@10.2.0","_nodeVersion":"14.11.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-ElqVNjPjIHj9xBhPw9qBwJwKaPO5IQ57o6KQENEOGbLvujNEmZtS+dL8PryNGnjxIr3cd2t7QGsGbWAJ/zCdsw==","shasum":"276769474298b9117a932e2a156f04a7c8056603","tarball":"https://registry.npmjs.org/@aegis-auth/jwt/-/jwt-10.2.0.tgz","fileCount":153,"unpackedSize":624190,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcMygCRA9TVsSAnZWagAAqRIP/A1TOjRWA/oOJ++E+R9m\n1Ix+KhJB3npVUzxD319Iee0nBG6tYLzx3qPonaSpaz550jp8yrJWYOxWcOH8\nvwEWPIuX0QlgHQU8r1njGl2zhHM/xKGoTJ6xZDT/+lKiHO2ERhrjTAiLaiT+\ne2oXKNAOxgwrfN4e4Ep0mkyXqi5XDLgHMjGosghnMxTFQvjqOXq/ptZqvogj\njHAcTWwses6hDdz81yI38x1MVQqNrcTlqeD7+jFAAVyGtqHV0++gpHKAGgBv\nVnJUS1cXl2ZcIB4xOhsARqDgUk/yf9vPaV6kubOBoc3wPd7swU+ao9GRpIMI\nyCw0NjFprEpKcpTdaMmYgueF4+7meNmOhEmu/e9doB/urI4xOVX4N1hnjuK0\nrtBJe20HgBsVWN8zc6+1Bro8AnKm0RfsfjMBGDORQ85Y/lzqzSbbx2O81PKC\nl/zTm92LEuyPK0AFocesijnMIg33k8S+UOp7aCb26UqXjRZzRL3k3Jqrr58e\niEk65Cw1dRnqaYdVMYXkXmMxaUDBh2Ct1wxlTCStsOsyEgvguSeSgWB0J6r8\ndb/ACSI2uB81g8wpPpaD1xHPTId3MGy/D5pkisLGNqt94JgXxY0lDPPbQtRS\ntphTWL96RYpMD1ccjO4xeoVnHq+OO9f4waPUE47xiJtoCVPlg83cDbbTDa6w\nEm6M\r\n=272k\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB1xfMIXEi0/iqGbiRtcZ+4hO+G4ubR8IqXGynaqRgaHAiEAx+XHWw9PraYXpWmHQh/dXOE0rWGUUXqgiUS/AxyhkUU="}]},"maintainers":[{"name":"alexaegis","email":"alexaegis@gmail.com"}],"_npmUser":{"name":"alexaegis","email":"alexaegis@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jwt_10.2.0_1601227935573_0.6117094432327361"},"_hasShrinkwrap":false},"9.2.0":{"name":"@aegis-auth/jwt","description":"Angular JWT authentication library","version":"9.2.0","license":"MIT","author":{"name":"AlexAegis","email":"alexaegis@gmail.com","url":"https://www.github.com/AlexAegis"},"homepage":"https://github.com/AlexAegis/auth/tree/master/libs/jwt#readme","repository":{"type":"git","url":"git+https://github.com/AlexAegis/auth.git"},"bugs":{"url":"https://www.github.com/AlexAegis/auth/issues"},"keywords":["ng","angular","jwt","token","auth","authentication","rxjs","reactive","interceptor","ts","typescript","js","javascript"],"peerDependencies":{"@angular/common":"9.*.*","@angular/core":"9.*.*","@angular/router":"9.*.*","rxjs":"6.5.*"},"dependencies":{"js-base64":"^3.5.2","tslib":"1.10.*"},"main":"bundles/aegis-auth-jwt.umd.js","module":"fesm2015/aegis-auth-jwt.js","es2015":"fesm2015/aegis-auth-jwt.js","esm2015":"esm2015/aegis-auth-jwt.js","fesm2015":"fesm2015/aegis-auth-jwt.js","typings":"aegis-auth-jwt.d.ts","metadata":"aegis-auth-jwt.metadata.json","sideEffects":false,"readme":"# jwt\n\n<!-- markdownlint-disable MD013 -->\n\n[![NG9 NPM Version](https://img.shields.io/npm/v/@aegis-auth/jwt/ng9)](https://www.npmjs.com/package/@aegis-auth/jwt/v/ng9)\n\n<!-- markdownlint-enable MD013 -->\n\nHandles common JWT use-cases, like adding the access token to\nrequests **and automatically refreshing it when needed**.\n\nIt consists of a `JwtModule` with two configurable Interceptors, and a helper\nservice to access your parsed and typed tokens.\n\nIt also provides a way to handle cases where a refresh cannot happen\n(For example: both token expired) with a redirection (As thats the most\ncommon recovery method) or a completely custom function for more advanced\nuse-cases.\n\n## Installation\n\nUsing npm\n\n```sh\nnpm i @aegis-auth/jwt\n```\n\nUsing yarn\n\n```sh\nyarn add @aegis-auth/jwt\n```\n\n## Usage\n\nFor an example app visit the [jwt-demo](../../apps/jwt-demo) application.\nIt's small and simple.\n\n### Configuration\n\nThe heart of the library is the `JwtModule` and it's `forRoot` method which\nhelps you configure it's providers.\n\n#### Basic usage\n\nFor simple usecases, where you only want to have the access token injected\ninto your http headers, you only need to configure the first provider, like so.\n\n> The provider definitions in this project are typed! While configuring it\n> you will always have knowledge on what you can configure and how, right\n> there! There is JSDoc hint for each!\n\nThis is the simplest possible configuration, where you put your tokens into\nlocalstorage. Remember that the library will call **this `getToken`** function\nevery time it needs to use the token!\n\n```ts\nJwtModule.forRoot({\n  useValue: {\n    getToken: () => localStorage.getItem('accessToken'),\n  },\n});\n```\n\nI recommend using a `BehaviorSubject` in a service, so it can stay in memory,\nit still can be initialized from the `localStorage` and with a subscription\nyou can always save the changes.\n([Example](../../apps/jwt-demo/src/app/service/auth.service.ts))\n\nFor this, you would use a factory provider with this service as it's\ndependency:\n\n```ts\nJwtModule.forRoot({\n  useFactory: (authService: AuthService) => ({\n    getToken: authService.accessTokenStorage$,\n    domainWhitelist: ['localhost'],\n  }),\n  deps: [AuthService],\n});\n```\n\nConfiguring this provider causes an HTTP Interceptor to be activated. It will\nappend the acquired token in a configurable header on every request where it's\napplicable.\n\n##### Configuration options\n\n```ts\ninterface JwtConfiguration extends UrlFilter {\n  /**\n   * A callback or observable that will be called or subscribed to\n   * on every http request and returns a value for the header\n   *\n   * @example getValue: () => localstorage.get('foo')\n   * @example getValue: myTokenService.foo$\n   */\n  getToken:\n    | Observable<string | null | undefined>\n    | (() =>\n        | string\n        | null\n        | undefined\n        | Promise<string | null | undefined>\n        | Observable<string | null | undefined>);\n\n  /**\n   * The prefix of the token when injecting. Notice thet the trailing\n   * whitespace has to be set here\n   *\n   * @default 'Bearer '\n   */\n  scheme?: string;\n\n  /**\n   * Header name to be set\n   *\n   * @default 'Authorization'\n   */\n  header: string;\n\n  /**\n   * This callback is called when the request fails and there is no\n   * RefreshConfiguration, or when the access token is simply missing.\n   * `getToken` returned a nullish value. If the RefreshConfiguration is\n   * available, then the error handling continues in the same fashion on\n   * the other configuration.\n   *\n   * Both have the same names and signature for\n   * both the error handling configuration options `onFailure` and\n   * `onFailureRedirectParameters`, so if you wish to use the same for both\n   * implement them outside, and spread them back. You can use the\n   * `JwtErrorHandling` interface to help you with the typing. Although\n   * thats a bit wider when it comes to the error types.\n   *\n   * If it's a string, instead of calling it, a redirection will happen,\n   * with `onFailureRedirectParameters` as it's queryParams.\n   */\n  onFailure?: string | ((jwtError: JwtError) => void);\n\n  /**\n   * This option is only used when the `onFailure` option is a string\n   * so it's handled as a redirect. When this happens, you can define\n   * the queryparams to be used with this redirect.\n   */\n  onFailureRedirectParameters?:\n    | ((error: JwtError) => HttpParams | Params)\n    | HttpParams\n    | Params;\n}\n```\n\nThese properties are available on the configuration, and are used to control\nwhat Urls can or can not recieve the token\n\n```ts\ninterface UrlFilter {\n  /**\n   * These domains won't recieve this header even if they are listed in the\n   * whitelist.\n   *\n   * If `null` or `undefined`, this category of rules won't take any effect.\n   * If empty, it would mean \"No domains are blacklisted\", and it won't\n   * take any effect.\n   *\n   * @default undefined\n   * @example ['localhost:3333']\n   * @example [/localhost:[0-9]{4}/]\n   */\n  domainBlacklist?: (string | RegExp)[];\n\n  /**\n   * Only domains listed will be recieving header injections\n   *\n   * If `null` or `undefined`, this category of rules won't take any effect.\n   * If empty, it would mean \"No domains are whitelisted\", so no paths would\n   * recieve tokens!\n   *\n   * @default undefined\n   * @example ['localhost:3333']\n   * @example [/localhost:[0-9]{4}/]\n   */\n  domainWhitelist?: (string | RegExp)[];\n\n  /**\n   * These paths won't recieve this header even if they are listed in the\n   * whitelist.\n   *\n   * If `null` or `undefined`, this category of rules won't take any effect.\n   * If empty, it would mean \"No paths are blacklisted\", and it won't\n   * take any effect.\n   *\n   * @default undefined\n   * @example ['api/v2/users/1']\n   * @example [/users\\/.+/]\n   */\n  pathBlacklist?: (string | RegExp)[];\n\n  /**\n   * Only paths listed will be recieving this header injection.\n   *\n   * If `null` or `undefined`, this category of rules won't take any effect.\n   * If empty, it would mean \"No paths are whitelisted\", so no paths would\n   * recieve tokens!\n   *\n   * @default undefined\n   * @example ['api/v2/users/1']\n   * @example [/users\\/.+/]\n   */\n  pathWhitelist?: (string | RegExp)[];\n\n  /**\n   * These protocols won't recieve this header even if they are listed in\n   * the whitelist.\n   *\n   * If `null` or `undefined`, this category of rules won't take any effect.\n   * If empty, it would mean \"No protocols are blacklisted\", and it won't\n   * take any effect.\n   *\n   * @default undefined\n   * @example ['http']\n   * @example [/https?/]\n   */\n  protocolBlacklist?: (string | RegExp)[];\n\n  /**\n   * Only protocols listed will be recieving this header injections.\n   *\n   * If empty or undefined, this category of rules won't take any effect.\n   * If empty, it would mean \"No protocols are whitelisted\", so no protocols\n   * would recieve tokens!\n   *\n   * @default undefined\n   * @example ['http']\n   * @example [/https?/]\n   */\n  protocolWhitelist?: (string | RegExp)[];\n}\n```\n\n#### Refreshing usage\n\nYou can optionally configure a second provider. If you do, another HTTP\nInterceptor will make sure that if an endpoint that needs to recieve an\n`accessToken`, and the provided one is expired, it first visits the\nconfigured refresh endpoint, optionally refreshes your storage, and retries the\noriginally intended request with the newly acquired, fresh access token.\n\nIt can also do the same if the original token wasn't expired, but the server\nrejected it (For example, the server can have a blacklist mechanic on login).\nIt only retries once, and by default it only does the retry if the error\nstatus was `401`, Unauthorized.\n\n##### Refresh configuration options\n\nBecause handling refreshes is not standardized instead of asking for the\nrefresh token directly I ask you to provide the request itself, however you\nlike to. In these callbacks you can access your refreshToken wherever you\nstore it.\n\nThe reason it's configured through multiple properties instead of a callback\nwhere I let you do the refresh request however you see fit is to make sure the\nrefreshUrl is known to avoid potentional infinite requests when hitting the\nrefresh endpoint. This way you don't have to remember setting this into the\nurl filter manually.\n\n````ts\nexport interface JwtRefreshConfiguration<RefreshRequest, RefreshResponse>\n  extends UrlFilter,\n    HttpErrorFilter {\n  /**\n   * After a successful refresh, this callback will be called.\n   * You need to define a function which will save the the token in a way\n   * that if the interceptor calls `getToken` again, it will get the token\n   * saved with this method.\n   *\n   * @example using `localStorage`\n   *    setToken: (response) => localStorage.setItem('accessToken', response.accessToken)\n   * @example using a service.\n   *\n   * ```typescript\n   * AuthCoreModule.forRoot<TokenStorageService>({\n   *    useFactory: (service: TokenStorageService) => ({\n   *      getToken: service.accessToken$\n   *      autoRefresher: {\n   *         endpoint: `${environment.api}/auth/refresh`,\n   *         setRefreshToken: (response) => service.accessToken$.next(response.accessToken)\n   *       }\n   *    }),\n   *    deps: [TokenStorageService],\n   * })\n   * ```\n   *\n   */\n  setRefreshedTokens: (response: JwtRefreshResponse) => void;\n\n  /**\n   * The method for the request, usually it's a POST so that's the default\n   *\n   * @default 'POST'\n   */\n  method?: HttpMethodType;\n  /**\n   * The endpoint that will be requested for a new token\n   */\n  refreshUrl: string;\n  /**\n   * A callback that should return the body of the request\n   */\n  createRefreshRequestBody: () => RefreshRequest;\n  /**\n   * A callback that should return the defaults on the request\n   */\n  refreshRequestInitials?:\n    | (() => HttpRequestInit | undefined)\n    | HttpRequestInit;\n  /**\n   * This function have to transform the result of your refresh endpoint\n   * into a digestable form. It will be called after successful refreshes.\n   */\n  transformRefreshResponse: (response: RefreshResponse) => JwtRefreshResponse;\n\n  /**\n   * This callback is called when a refresh either failed or cannot be done.\n   * This marks the point where both tokens are invalid and the user needs to\n   * relog. Because this is usually done through a login page, aside from a\n   * regular callback, a string can also be supplied which will act as the\n   * target of navigation. Check `onFailureRedirectParameters` if you wish\n   * to supply query parameters. For more advanced usage, consider\n   * implementing it as a custom function, the error object is available\n   * there too!\n   */\n  onFailure?:\n    | string\n    | ((error: JwtCouldntRefreshError | JwtCannotRefreshError) => void);\n\n  onFailureRedirectParameters?:\n    | ((\n        error: JwtCouldntRefreshError | JwtCannotRefreshError\n      ) => HttpParams | Params)\n    | HttpParams\n    | Params;\n\n  /**\n   * Optional!\n   *\n   * Not used in the refresh mechanic! See `createRefreshRequestBody` if you\n   * need to provide the `refreshToken` in the body when making the refresh\n   * request or `refreshRequestInitials` when it's handled in a header!\n   *\n   * A callback or observable that can be used to retrieve the refresh token\n   * Not used in the interceptor! it is only used in the helper service if\n   * you with to interact with the parsed refreshToken throught the helper\n   * observables. If you do not, you don't have to implement this.\n   *\n   * @example getValue: () => localstorage.get('foo')\n   * @example getValue: myTokenService.foo$\n   */\n  getRefreshToken?:\n    | Observable<string | null | undefined>\n    | (() =>\n        | string\n        | null\n        | undefined\n        | Promise<string | null | undefined>\n        | Observable<string | null | undefined>);\n\n  /**\n   * When using the LoginGuard this setting will determine the default\n   * value. So instead of disabling the autoRefresh behavior on every\n   * route with the data option, or writing your own guard (Which would\n   * be really simple) just set this to false. You can still override it\n   * using route data.\n   *\n   * See the LoginGuardData helper interface to see what it can utilize.\n   *\n   * @default true\n   */\n  isAutoRefreshAllowedInLoginGuardByDefault?: boolean;\n}\n````\n\nAll options on the URLFilter are also available here too to further restrict\nwhat endpoint can be refreshed.\n\nAdditionally, it can filter on the return status of a failed request\n\n```ts\nexport interface HttpErrorFilter {\n  /**\n   * The error codes on which an act is allowed to happen,\n   * an empty array means it can't act on anything\n   *\n   * @default [401]\n   */\n  errorCodeWhitelist?: number[];\n\n  /**\n   * The error codes on which an act is not allowed to happen,\n   * an empty array (and if undefined) means it can always try a single\n   * act in case of an error\n   *\n   * @default undefined\n   */\n  errorCodeBlacklist?: number[];\n}\n```\n\n### The helper service\n\nThe provided\n[`JwtTokenService<Claims>`](./src/lib/service/jwt-token.service.ts) is a\nservice consisting of Observable pipelines all originating from the\ngetToken property in your configuration provided by you.\n\nThere are observables to acquire the raw tokens:\n\n- `rawAccessToken$: Observable<string | null | undefined>`\n- `rawRefreshToken$: Observable<string | null | undefined>`\n\nThe parsed tokens:\n\n- `accessToken$: Observable<JwtToken<Claims> | null>`\n- `refreshToken$: Observable<JwtToken<Claims> | null>`\n\nWhere `JwtToken<Claims>` is:\n\n```ts\nclass JwtToken<Claims extends {}> {\n  header: JwtTokenHeader, // Based on RFC 7519\n  payload: JwtTokenPayload & Claims, // Based on RFC 7519\n  signature: string,\n  isExpired: () => boolean\n}\n```\n\nThe headers:\n\n- `accessTokenHeader$: Observable<JwtTokenHeader | null>`\n- `refreshTokenHeader$: Observable<JwtTokenHeader | null>`\n\nThe payloads:\n\n- `accessTokenHeader$: Observable<(JwtTokenPayload & Claims) | null>`\n- `refreshTokenHeader$: Observable<(JwtTokenPayload & RefreshClaims) | null>`\n\nAnd if they are expired or not:\n\n- `isAccessTokenExpired$: Observable<boolean>`\n- `isRefreshTokenExpired$: Observable<boolean>`\n\nThe payload is used to carry custom claims. These can be defined by you and\npassed to the service on injection as a generic. Though often not used, the\nsecond generic allows to define the extra claims on the refresh token.\n\n```ts\nexport interface MyClaims {\n  username: string;\n}\n\nexport class MyService {\n  constructor(private readonly jwtTokenService: JwtTokenService<MyClaims>) {\n    this.jwtTokenService.accessToken$.pipe(\n      map((token) => token?.payload.username) // Here, `username` is a string\n    );\n  }\n}\n```\n\nRemember, that the helper service has to inject the configuration inside it,\nso if you would try to inject this service into any of the dependencies of the\nconfigurations provider of the JwtModule, you would get a cyclic dependency.\n\nBut since this helper servise does not contain any functions, you can't pass\nany more information to it. That means it can be used independently.\n\nIf you do need to use your original dependency and this helper service together\nI recommend making that original dependency into a simple storage with\n2 `BehaviorSubject`s, and making another service where you can inject both.\n\nIn the example application, the `AuthService` acts both as the storage of the\ntokens, and some methods on doing `login`, `refresh` and `logout`.\n\nThis demo `AuthService` only has to manage the token storage, the library\nwill always use the latest values.\n\n### The LoginGuard\n\nUsing the LoginGuard on a route means that the route and all of its children\ncannot open unless there is a valid accessToken available. Since tokens are\nonly refreshed on-demand it's possible that after an idle time that is longer\nthan the accessTokens lifetime, that on guard activation the token is expired.\n\nFor this reason, the guard does a `manualRefresh` if the token is invalid.\n\nThe autorefreshing is controllable with a configuration option on the refresh\nconfiguration and per route with route data. See `LoginGuardData` for what is\navailable.\n\n```ts\n/**\n * This interface is for your convinience to use with Route data to see what\n * you can configure on the LoginGuard\n */\nexport interface LoginGuardData {\n  /**\n   * Explicitly enable or disable auto refreshing on the route.\n   */\n  isRefreshAllowed: boolean;\n}\n```\n\nIf you need something more custom, I highly recommend implementing your own\nguard as `LoginGuard` itself is also really simple.\n","readmeFilename":"readme.md","_id":"@aegis-auth/jwt@9.2.0","_nodeVersion":"14.11.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-SRnhdflbOlcy2Jh3WeuaKn+KqvXAdgLo6qfMloqhZdukKAAL7FlhKO2KnsO+dohqU02qqXJeQOGsHfTOtjcGXA==","shasum":"e01e501ac485bd63311159069c071af2746ceace","tarball":"https://registry.npmjs.org/@aegis-auth/jwt/-/jwt-9.2.0.tgz","fileCount":153,"unpackedSize":621296,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcOHrCRA9TVsSAnZWagAAqDgQAI432+W0Wm6UBcAUz89K\nhSx8Z8JaZaAq/rBEKOro1aLifeC+Bq09t5jEqMqfajWPAgvt2jOdbbrOJSmL\niUIoTF+D+mQZQFXH4DK4KLf4I5VFHJie5XBc2SFRAFtXLKMLRZ8Ef3EXrTgk\nhV2yzt7CivgtdOGbJNIPQMXwwYS0AfHY6HYrgjsXk7CdK6SzFECpSLXkDbjN\nwcKVAI9BizGUjg/5mgjPAewgeyS3K9ozTOw1WX5OI2dzpYn+HVCsgZxT1WSJ\n6GlIZJNm1EIlrEMSx2PmQ4Pnec8tVdaRPowHpIZ0wUu3SR0uDGXRS6DkGiDH\n6sx2kVY9nNGH2f8lUJV+evv+0wNfkKz6BUjZULLl9IsH9YtgEXjDi30ZLIa1\nuqxVWeqK2RjoJdprSC7yoU8UMI2xQlB6Br/g2fJuT251zB4gPgc1IOx5QOTK\nhgOQ+7fLOvQQPIjd3GT5TivafUlWoUdqPMBww6YFCL/gKsYjKZJonEcAmbIj\ngRvTU1AXWE2621tG8uTYexeHsMIdVRwbcBJVkToOwDmdBotLY4NQ5fW/zOtx\nOPA8TgE31CO1r9QPTxNVM8YNj5MTJO20EgeMPfdRtc28lcOAhpGx7pUPkjlH\n4O3CG0HWTGRPscg+XV6qD+lzrLENltUCGw2/E39JZV0uu6Xgbj2dlt+5xUuN\nHFc8\r\n=pNMa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCYqt58jxzg+5L74ZWt+h3EKEH1KgOPJLkakgIk1OQgtQIgD/MV0D8SONWMYWChYjTNMZGHZNrFJIBVihuR2MI2i4E="}]},"maintainers":[{"name":"alexaegis","email":"alexaegis@gmail.com"}],"_npmUser":{"name":"alexaegis","email":"alexaegis@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jwt_9.2.0_1601233387153_0.37343476624997574"},"_hasShrinkwrap":false},"8.2.0":{"name":"@aegis-auth/jwt","description":"Angular JWT authentication library","version":"8.2.0","license":"MIT","author":{"name":"AlexAegis","email":"alexaegis@gmail.com","url":"https://www.github.com/AlexAegis"},"homepage":"https://github.com/AlexAegis/auth/tree/master/libs/jwt#readme","repository":{"type":"git","url":"git+https://github.com/AlexAegis/auth.git"},"bugs":{"url":"https://www.github.com/AlexAegis/auth/issues"},"keywords":["ng","angular","jwt","token","auth","authentication","rxjs","reactive","interceptor","ts","typescript","js","javascript"],"peerDependencies":{"@angular/common":"8.*.*","@angular/core":"8.*.*","@angular/router":"8.*.*","rxjs":"6.4.*"},"dependencies":{"js-base64":"^3.5.2","tslib":"1.9.*"},"main":"bundles/aegis-auth-jwt.umd.js","module":"fesm2015/aegis-auth-jwt.js","es2015":"fesm2015/aegis-auth-jwt.js","esm2015":"esm2015/aegis-auth-jwt.js","fesm2015":"fesm2015/aegis-auth-jwt.js","typings":"aegis-auth-jwt.d.ts","metadata":"aegis-auth-jwt.metadata.json","sideEffects":false,"readme":"# jwt\n\n<!-- markdownlint-disable MD013 -->\n\n[![NG8 NPM Version](https://img.shields.io/npm/v/@aegis-auth/jwt/ng8)](https://www.npmjs.com/package/@aegis-auth/jwt/v/ng9)\n\n<!-- markdownlint-enable MD013 -->\n\nHandles common JWT use-cases, like adding the access token to\nrequests **and automatically refreshing it when needed**.\n\nIt consists of a `JwtModule` with two configurable Interceptors, and a helper\nservice to access your parsed and typed tokens.\n\nIt also provides a way to handle cases where a refresh cannot happen\n(For example: both token expired) with a redirection (As thats the most\ncommon recovery method) or a completely custom function for more advanced\nuse-cases.\n\n## Installation\n\nUsing npm\n\n```sh\nnpm i @aegis-auth/jwt\n```\n\nUsing yarn\n\n```sh\nyarn add @aegis-auth/jwt\n```\n\n## Usage\n\nFor an example app visit the [jwt-demo](../../apps/jwt-demo) application.\nIt's small and simple.\n\n### Configuration\n\nThe heart of the library is the `JwtModule` and it's `forRoot` method which\nhelps you configure it's providers.\n\n#### Basic usage\n\nFor simple usecases, where you only want to have the access token injected\ninto your http headers, you only need to configure the first provider, like so.\n\n> The provider definitions in this project are typed! While configuring it\n> you will always have knowledge on what you can configure and how, right\n> there! There is JSDoc hint for each!\n\nThis is the simplest possible configuration, where you put your tokens into\nlocalstorage. Remember that the library will call **this `getToken`** function\nevery time it needs to use the token!\n\n```ts\nJwtModule.forRoot({\n  useValue: {\n    getToken: () => localStorage.getItem('accessToken'),\n  },\n});\n```\n\nI recommend using a `BehaviorSubject` in a service, so it can stay in memory,\nit still can be initialized from the `localStorage` and with a subscription\nyou can always save the changes.\n([Example](../../apps/jwt-demo/src/app/service/auth.service.ts))\n\nFor this, you would use a factory provider with this service as it's\ndependency:\n\n```ts\nJwtModule.forRoot({\n  useFactory: (authService: AuthService) => ({\n    getToken: authService.accessTokenStorage$,\n    domainWhitelist: ['localhost'],\n  }),\n  deps: [AuthService],\n});\n```\n\nConfiguring this provider causes an HTTP Interceptor to be activated. It will\nappend the acquired token in a configurable header on every request where it's\napplicable.\n\n##### Configuration options\n\n```ts\ninterface JwtConfiguration extends UrlFilter {\n  /**\n   * A callback or observable that will be called or subscribed to\n   * on every http request and returns a value for the header\n   *\n   * @example getValue: () => localstorage.get('foo')\n   * @example getValue: myTokenService.foo$\n   */\n  getToken:\n    | Observable<string | null | undefined>\n    | (() =>\n        | string\n        | null\n        | undefined\n        | Promise<string | null | undefined>\n        | Observable<string | null | undefined>);\n\n  /**\n   * The prefix of the token when injecting. Notice thet the trailing\n   * whitespace has to be set here\n   *\n   * @default 'Bearer '\n   */\n  scheme?: string;\n\n  /**\n   * Header name to be set\n   *\n   * @default 'Authorization'\n   */\n  header: string;\n\n  /**\n   * This callback is called when the request fails and there is no\n   * RefreshConfiguration, or when the access token is simply missing.\n   * `getToken` returned a nullish value. If the RefreshConfiguration is\n   * available, then the error handling continues in the same fashion on\n   * the other configuration.\n   *\n   * Both have the same names and signature for\n   * both the error handling configuration options `onFailure` and\n   * `onFailureRedirectParameters`, so if you wish to use the same for both\n   * implement them outside, and spread them back. You can use the\n   * `JwtErrorHandling` interface to help you with the typing. Although\n   * thats a bit wider when it comes to the error types.\n   *\n   * If it's a string, instead of calling it, a redirection will happen,\n   * with `onFailureRedirectParameters` as it's queryParams.\n   */\n  onFailure?: string | ((jwtError: JwtError) => void);\n\n  /**\n   * This option is only used when the `onFailure` option is a string\n   * so it's handled as a redirect. When this happens, you can define\n   * the queryparams to be used with this redirect.\n   */\n  onFailureRedirectParameters?:\n    | ((error: JwtError) => HttpParams | Params)\n    | HttpParams\n    | Params;\n}\n```\n\nThese properties are available on the configuration, and are used to control\nwhat Urls can or can not recieve the token\n\n```ts\ninterface UrlFilter {\n  /**\n   * These domains won't recieve this header even if they are listed in the\n   * whitelist.\n   *\n   * If `null` or `undefined`, this category of rules won't take any effect.\n   * If empty, it would mean \"No domains are blacklisted\", and it won't\n   * take any effect.\n   *\n   * @default undefined\n   * @example ['localhost:3333']\n   * @example [/localhost:[0-9]{4}/]\n   */\n  domainBlacklist?: (string | RegExp)[];\n\n  /**\n   * Only domains listed will be recieving header injections\n   *\n   * If `null` or `undefined`, this category of rules won't take any effect.\n   * If empty, it would mean \"No domains are whitelisted\", so no paths would\n   * recieve tokens!\n   *\n   * @default undefined\n   * @example ['localhost:3333']\n   * @example [/localhost:[0-9]{4}/]\n   */\n  domainWhitelist?: (string | RegExp)[];\n\n  /**\n   * These paths won't recieve this header even if they are listed in the\n   * whitelist.\n   *\n   * If `null` or `undefined`, this category of rules won't take any effect.\n   * If empty, it would mean \"No paths are blacklisted\", and it won't\n   * take any effect.\n   *\n   * @default undefined\n   * @example ['api/v2/users/1']\n   * @example [/users\\/.+/]\n   */\n  pathBlacklist?: (string | RegExp)[];\n\n  /**\n   * Only paths listed will be recieving this header injection.\n   *\n   * If `null` or `undefined`, this category of rules won't take any effect.\n   * If empty, it would mean \"No paths are whitelisted\", so no paths would\n   * recieve tokens!\n   *\n   * @default undefined\n   * @example ['api/v2/users/1']\n   * @example [/users\\/.+/]\n   */\n  pathWhitelist?: (string | RegExp)[];\n\n  /**\n   * These protocols won't recieve this header even if they are listed in\n   * the whitelist.\n   *\n   * If `null` or `undefined`, this category of rules won't take any effect.\n   * If empty, it would mean \"No protocols are blacklisted\", and it won't\n   * take any effect.\n   *\n   * @default undefined\n   * @example ['http']\n   * @example [/https?/]\n   */\n  protocolBlacklist?: (string | RegExp)[];\n\n  /**\n   * Only protocols listed will be recieving this header injections.\n   *\n   * If empty or undefined, this category of rules won't take any effect.\n   * If empty, it would mean \"No protocols are whitelisted\", so no protocols\n   * would recieve tokens!\n   *\n   * @default undefined\n   * @example ['http']\n   * @example [/https?/]\n   */\n  protocolWhitelist?: (string | RegExp)[];\n}\n```\n\n#### Refreshing usage\n\nYou can optionally configure a second provider. If you do, another HTTP\nInterceptor will make sure that if an endpoint that needs to recieve an\n`accessToken`, and the provided one is expired, it first visits the\nconfigured refresh endpoint, optionally refreshes your storage, and retries the\noriginally intended request with the newly acquired, fresh access token.\n\nIt can also do the same if the original token wasn't expired, but the server\nrejected it (For example, the server can have a blacklist mechanic on login).\nIt only retries once, and by default it only does the retry if the error\nstatus was `401`, Unauthorized.\n\n##### Refresh configuration options\n\nBecause handling refreshes is not standardized instead of asking for the\nrefresh token directly I ask you to provide the request itself, however you\nlike to. In these callbacks you can access your refreshToken wherever you\nstore it.\n\nThe reason it's configured through multiple properties instead of a callback\nwhere I let you do the refresh request however you see fit is to make sure the\nrefreshUrl is known to avoid potentional infinite requests when hitting the\nrefresh endpoint. This way you don't have to remember setting this into the\nurl filter manually.\n\n````ts\nexport interface JwtRefreshConfiguration<RefreshRequest, RefreshResponse>\n  extends UrlFilter,\n    HttpErrorFilter {\n  /**\n   * After a successful refresh, this callback will be called.\n   * You need to define a function which will save the the token in a way\n   * that if the interceptor calls `getToken` again, it will get the token\n   * saved with this method.\n   *\n   * @example using `localStorage`\n   *    setToken: (response) => localStorage.setItem('accessToken', response.accessToken)\n   * @example using a service.\n   *\n   * ```typescript\n   * AuthCoreModule.forRoot<TokenStorageService>({\n   *    useFactory: (service: TokenStorageService) => ({\n   *      getToken: service.accessToken$\n   *      autoRefresher: {\n   *         endpoint: `${environment.api}/auth/refresh`,\n   *         setRefreshToken: (response) => service.accessToken$.next(response.accessToken)\n   *       }\n   *    }),\n   *    deps: [TokenStorageService],\n   * })\n   * ```\n   *\n   */\n  setRefreshedTokens: (response: JwtRefreshResponse) => void;\n\n  /**\n   * The method for the request, usually it's a POST so that's the default\n   *\n   * @default 'POST'\n   */\n  method?: HttpMethodType;\n  /**\n   * The endpoint that will be requested for a new token\n   */\n  refreshUrl: string;\n  /**\n   * A callback that should return the body of the request\n   */\n  createRefreshRequestBody: () => RefreshRequest;\n  /**\n   * A callback that should return the defaults on the request\n   */\n  refreshRequestInitials?:\n    | (() => HttpRequestInit | undefined)\n    | HttpRequestInit;\n  /**\n   * This function have to transform the result of your refresh endpoint\n   * into a digestable form. It will be called after successful refreshes.\n   */\n  transformRefreshResponse: (response: RefreshResponse) => JwtRefreshResponse;\n\n  /**\n   * This callback is called when a refresh either failed or cannot be done.\n   * This marks the point where both tokens are invalid and the user needs to\n   * relog. Because this is usually done through a login page, aside from a\n   * regular callback, a string can also be supplied which will act as the\n   * target of navigation. Check `onFailureRedirectParameters` if you wish\n   * to supply query parameters. For more advanced usage, consider\n   * implementing it as a custom function, the error object is available\n   * there too!\n   */\n  onFailure?:\n    | string\n    | ((error: JwtCouldntRefreshError | JwtCannotRefreshError) => void);\n\n  onFailureRedirectParameters?:\n    | ((\n        error: JwtCouldntRefreshError | JwtCannotRefreshError\n      ) => HttpParams | Params)\n    | HttpParams\n    | Params;\n\n  /**\n   * Optional!\n   *\n   * Not used in the refresh mechanic! See `createRefreshRequestBody` if you\n   * need to provide the `refreshToken` in the body when making the refresh\n   * request or `refreshRequestInitials` when it's handled in a header!\n   *\n   * A callback or observable that can be used to retrieve the refresh token\n   * Not used in the interceptor! it is only used in the helper service if\n   * you with to interact with the parsed refreshToken throught the helper\n   * observables. If you do not, you don't have to implement this.\n   *\n   * @example getValue: () => localstorage.get('foo')\n   * @example getValue: myTokenService.foo$\n   */\n  getRefreshToken?:\n    | Observable<string | null | undefined>\n    | (() =>\n        | string\n        | null\n        | undefined\n        | Promise<string | null | undefined>\n        | Observable<string | null | undefined>);\n\n  /**\n   * When using the LoginGuard this setting will determine the default\n   * value. So instead of disabling the autoRefresh behavior on every\n   * route with the data option, or writing your own guard (Which would\n   * be really simple) just set this to false. You can still override it\n   * using route data.\n   *\n   * See the LoginGuardData helper interface to see what it can utilize.\n   *\n   * @default true\n   */\n  isAutoRefreshAllowedInLoginGuardByDefault?: boolean;\n}\n````\n\nAll options on the URLFilter are also available here too to further restrict\nwhat endpoint can be refreshed.\n\nAdditionally, it can filter on the return status of a failed request\n\n```ts\nexport interface HttpErrorFilter {\n  /**\n   * The error codes on which an act is allowed to happen,\n   * an empty array means it can't act on anything\n   *\n   * @default [401]\n   */\n  errorCodeWhitelist?: number[];\n\n  /**\n   * The error codes on which an act is not allowed to happen,\n   * an empty array (and if undefined) means it can always try a single\n   * act in case of an error\n   *\n   * @default undefined\n   */\n  errorCodeBlacklist?: number[];\n}\n```\n\n### The helper service\n\nThe provided\n[`JwtTokenService<Claims>`](./src/lib/service/jwt-token.service.ts) is a\nservice consisting of Observable pipelines all originating from the\ngetToken property in your configuration provided by you.\n\nThere are observables to acquire the raw tokens:\n\n- `rawAccessToken$: Observable<string | null | undefined>`\n- `rawRefreshToken$: Observable<string | null | undefined>`\n\nThe parsed tokens:\n\n- `accessToken$: Observable<JwtToken<Claims> | null>`\n- `refreshToken$: Observable<JwtToken<Claims> | null>`\n\nWhere `JwtToken<Claims>` is:\n\n```ts\nclass JwtToken<Claims extends {}> {\n  header: JwtTokenHeader, // Based on RFC 7519\n  payload: JwtTokenPayload & Claims, // Based on RFC 7519\n  signature: string,\n  isExpired: () => boolean\n}\n```\n\nThe headers:\n\n- `accessTokenHeader$: Observable<JwtTokenHeader | null>`\n- `refreshTokenHeader$: Observable<JwtTokenHeader | null>`\n\nThe payloads:\n\n- `accessTokenHeader$: Observable<(JwtTokenPayload & Claims) | null>`\n- `refreshTokenHeader$: Observable<(JwtTokenPayload & RefreshClaims) | null>`\n\nAnd if they are expired or not:\n\n- `isAccessTokenExpired$: Observable<boolean>`\n- `isRefreshTokenExpired$: Observable<boolean>`\n\nThe payload is used to carry custom claims. These can be defined by you and\npassed to the service on injection as a generic. Though often not used, the\nsecond generic allows to define the extra claims on the refresh token.\n\n```ts\nexport interface MyClaims {\n  username: string;\n}\n\nexport class MyService {\n  constructor(private readonly jwtTokenService: JwtTokenService<MyClaims>) {\n    this.jwtTokenService.accessToken$.pipe(\n      map((token) => token?.payload.username) // Here, `username` is a string\n    );\n  }\n}\n```\n\nRemember, that the helper service has to inject the configuration inside it,\nso if you would try to inject this service into any of the dependencies of the\nconfigurations provider of the JwtModule, you would get a cyclic dependency.\n\nBut since this helper servise does not contain any functions, you can't pass\nany more information to it. That means it can be used independently.\n\nIf you do need to use your original dependency and this helper service together\nI recommend making that original dependency into a simple storage with\n2 `BehaviorSubject`s, and making another service where you can inject both.\n\nIn the example application, the `AuthService` acts both as the storage of the\ntokens, and some methods on doing `login`, `refresh` and `logout`.\n\nThis demo `AuthService` only has to manage the token storage, the library\nwill always use the latest values.\n\n### The LoginGuard\n\nUsing the LoginGuard on a route means that the route and all of its children\ncannot open unless there is a valid accessToken available. Since tokens are\nonly refreshed on-demand it's possible that after an idle time that is longer\nthan the accessTokens lifetime, that on guard activation the token is expired.\n\nFor this reason, the guard does a `manualRefresh` if the token is invalid.\n\nThe autorefreshing is controllable with a configuration option on the refresh\nconfiguration and per route with route data. See `LoginGuardData` for what is\navailable.\n\n```ts\n/**\n * This interface is for your convinience to use with Route data to see what\n * you can configure on the LoginGuard\n */\nexport interface LoginGuardData {\n  /**\n   * Explicitly enable or disable auto refreshing on the route.\n   */\n  isRefreshAllowed: boolean;\n}\n```\n\nIf you need something more custom, I highly recommend implementing your own\nguard as `LoginGuard` itself is also really simple.\n","readmeFilename":"readme.md","_id":"@aegis-auth/jwt@8.2.0","_nodeVersion":"14.11.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-J2M1qmPrGmuDrp8RyAdpmbDaPm3eMz3otMaCPPQz+6ivVjs6mo7VxMF2xFDNkvf9MlhMmKvnBoDydWmrYlUM5w==","shasum":"59663f62813af5955a70ce901ed341aa8cf2d8ef","tarball":"https://registry.npmjs.org/@aegis-auth/jwt/-/jwt-8.2.0.tgz","fileCount":153,"unpackedSize":623969,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcOhhCRA9TVsSAnZWagAAKjMP/0+EZN3pJFDT96qt4WtR\ntlA3GQKl5c7zy6swojzSAJAgHcshKKzf328QVXBOqzhwZZFPsv4guk2vDete\nJV2aPnhAsGk1irto8sGSxAQqjOuJfxpq1NIGH23F9Zb8ZSR3HE4Jj0PJ+6ys\nrWIO5NhWkUidq86f2xhu6IL6ShUq3q9FTJt2swocbgSTvFKvu3Tg6jO3tSGE\nE27lqq8fRAiYtBddr3kCU7hkgW3E4SWVoSE6jurXq5wGTAQurbRXZwnm1T5t\nsnA0kGP5VQc6aq/2o8NWk0hsPGpuXlVqp9amRui7Gc79BN9d+9N8tQXFq9Cg\n/ELB/G/sEx9H1Goj/PpFeoNCWpaDBv2aGT4ArN2NbFjoof6NjJ0ecnbeUtwC\nWHpTT80ffj6i9z1aO457ORE//Z2Ab3Iw7Ggsa7txbnL/vrMpeoKHEIGiRRJ4\nMzSnPUEDGQqc19P8CCO8EAWWV30QzEONSP/dK/Ie/5CLRiBCXU1j8ReivmEv\n7HOB6cAd1h7HBTh/1Qp/UpGqHJKdsFf5DVLRyQR6KkI2NZ12xhp4vdO/Rky/\nYYP5rl5Av87wtPweqdvN72BVc6C+GCgl2Yesg7f3QSf5TW4Ogl7CJeFbTX03\ncPE6OWLup14hqjQpBaa2IRTjnHCGx0vpDOvK82MANxTrX6JucRChnpuh5NIz\ncF5f\r\n=dZ5Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH25vKd93BJtyEi6LL/gBb5ELFJ/OMtEcHNobA03TnQyAiEA9zghvGvhkRbsX1na8JjKMb0DZ9pfDfu+h0AYw+beF14="}]},"maintainers":[{"name":"alexaegis","email":"alexaegis@gmail.com"}],"_npmUser":{"name":"alexaegis","email":"alexaegis@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jwt_8.2.0_1601235040826_0.5925351430770318"},"_hasShrinkwrap":false},"10.2.1":{"name":"@aegis-auth/jwt","description":"Angular JWT authentication library","version":"10.2.1","license":"MIT","author":{"name":"AlexAegis","email":"alexaegis@gmail.com","url":"https://www.github.com/AlexAegis"},"homepage":"https://github.com/AlexAegis/auth/tree/master/libs/jwt#readme","repository":{"type":"git","url":"git+https://github.com/AlexAegis/auth.git"},"bugs":{"url":"https://www.github.com/AlexAegis/auth/issues"},"keywords":["ng","angular","jwt","token","auth","authentication","rxjs","reactive","interceptor","ts","typescript","js","javascript"],"peerDependencies":{"@angular/common":"10.*.*","@angular/core":"10.*.*","@angular/router":"10.*.*","rxjs":"6.6.*"},"dependencies":{"js-base64":"^3.5.2","tslib":"2.*.*"},"main":"bundles/aegis-auth-jwt.umd.js","module":"fesm2015/aegis-auth-jwt.js","es2015":"fesm2015/aegis-auth-jwt.js","esm2015":"esm2015/aegis-auth-jwt.js","fesm2015":"fesm2015/aegis-auth-jwt.js","typings":"aegis-auth-jwt.d.ts","metadata":"aegis-auth-jwt.metadata.json","sideEffects":false,"_id":"@aegis-auth/jwt@10.2.1","_nodeVersion":"14.11.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-iPU3qAwKjy1GJKtPeaTK9uxK7AaYbETFNrfXWB618JYqJ5ONjt7vj/ZgMsYExBDKQXSEiWPyZObOihFOV1ivRA==","shasum":"f0979f364d3a8609da6ea14ae61fb597d95a454e","tarball":"https://registry.npmjs.org/@aegis-auth/jwt/-/jwt-10.2.1.tgz","fileCount":153,"unpackedSize":627472,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdFp3CRA9TVsSAnZWagAA9OkP/iRYo+WDuMjP2PA6aDPF\nK6O2KomcOWJHB5wnKzl5Q4kOBVbdRv2qGGUHepwveVuJhopVk0nNvQW5vdVA\n8d2q/ax8nuyRp8BsnzgJ3lBhFzUbLHqBOMPCB6PY2FH8Dcc731ECE/D0fXIm\n9c8sEx7Oxb+jEHPvZHlASRRWqtUagEEGGHaDZxPsZGIUTuT4Fxg3S5axUfxV\nzKMLekpigzg+XYtA0mKcfzIE5exaf8dW3+PKgt2FUdy6g7VB0cHj7Z9rcLgX\ntLFLrLlZ1027a8l4o8+NRV9nqeyPd3YntdnNi4yHCbSsTheXqIHXiU/xkRzm\nmRB5QaRkSu3D/MZGDs8oj/GogdOaRBQ01WzUkQLJIADDlLa4N6W7+pQlD8gG\nPjkgECzkBBWJH9ktVfdtoXcWozNSqPkfGbAMsOjrcRkbCMxoZayZefsqbztJ\nS/kE6yFo2XHneWQuO6F/TlzNtYjR/YR213jN/LC1sTmKK5RyrR0+s8fnrgj1\noPf62rJ7bKTIffnNhdTIM14DZEfbpfEjGhkG8slh30/BX6WfjHjcfPQPxnIy\nrZkAivPme6+yIjtWdH+eKWLKdWZ0/5I6sUiO0ozhtEHdxfe02C+kqCmaOVwz\nFXYAyG+gUX0ojMzxMSMVwniwSKLl8fzIy35JkdsBW8YmVy/ggc/ElbB64WXx\nSukp\r\n=gsdI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC7wPkY07Qntavc+l3l5oEiOBaFHCTRfbqgvbuH1W2npAiEAxD//LfbXQFDL4NA/GSF3E/92K8MIPNelftWqUXkN/tY="}]},"maintainers":[{"name":"alexaegis","email":"alexaegis@gmail.com"}],"_npmUser":{"name":"alexaegis","email":"alexaegis@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jwt_10.2.1_1601460854829_0.9990715923782931"},"_hasShrinkwrap":false},"10.2.2":{"name":"@aegis-auth/jwt","description":"Angular JWT authentication library","version":"10.2.2","license":"MIT","author":{"name":"AlexAegis","email":"alexaegis@gmail.com","url":"https://www.github.com/AlexAegis"},"homepage":"https://github.com/AlexAegis/auth/tree/master/libs/jwt#readme","repository":{"type":"git","url":"git+https://github.com/AlexAegis/auth.git"},"bugs":{"url":"https://www.github.com/AlexAegis/auth/issues"},"keywords":["ng","angular","jwt","token","auth","authentication","rxjs","reactive","interceptor","ts","typescript","js","javascript"],"peerDependencies":{"@angular/common":"10.*.*","@angular/core":"10.*.*","@angular/router":"10.*.*","rxjs":"6.6.*"},"dependencies":{"js-base64":"^3.5.2","tslib":"2.*.*"},"main":"bundles/aegis-auth-jwt.umd.js","module":"fesm2015/aegis-auth-jwt.js","es2015":"fesm2015/aegis-auth-jwt.js","esm2015":"esm2015/aegis-auth-jwt.js","fesm2015":"fesm2015/aegis-auth-jwt.js","typings":"aegis-auth-jwt.d.ts","metadata":"aegis-auth-jwt.metadata.json","sideEffects":false,"_id":"@aegis-auth/jwt@10.2.2","_nodeVersion":"14.11.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-92L6YYAiFg0nFOJo0uAJshL4bKFkBHkYE33Od5LMDjf169VBUvHbYXOWNlB6uxbd7Ou0KT3IByw1lkFVa+itPg==","shasum":"a83b44b176a8e5591eb1ec3fc6ffb485b9cf0267","tarball":"https://registry.npmjs.org/@aegis-auth/jwt/-/jwt-10.2.2.tgz","fileCount":153,"unpackedSize":627427,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdGY1CRA9TVsSAnZWagAAgwcP/Rw6YijtJJeeOSUphdEm\n2m78wBLpkdkOnc+BDulGyPSRqziVdE2jJe1YVlrpyC+gmgxMTdS8oxOaiG5h\nKtAPnA0J25cqG4MNPUxqSYFO64Nsu4JAnB0m/IpXnu82c41z/0iuhIqxzJgv\nGSXmEqU/MwhSlEI5AWZZ/jPGuAWq6Xq6Nf+aY0a1n50CQwmwv+/07eFb02qY\nNKUUaS9f+oXPpQyTJkazuLT8az6h36Y1eunAo4Xz1fQAxfAmYubIsC/YTrMx\nXNtZgqPr8WTZrSsAl69BRvnIZnVfLUMhFVSM7QUMDyTTkIJhN0OUmsSpissP\nq2sL98Wp2HbLB4rvUUa7nQrsZ8VnSOdHo/+xWGGzioswEhkPVuHFByXNTkcF\nqGiKPQFgGLl7G6/KPlwEV0i27VGWSqIsjrVNu7ag7vvT2m8REEBs/zNyZQZq\nYfvNay7Q7lJrRp3xOlCU2vh7lzumUqN/G8BrfuTkCo/8RuOrNy208lU5BOA6\n4jY2EzBsovKqj+LZCkU/MuOK026fEOWMjfQW6UNJzz7mNAMt+gu7TglnMb14\neMSMcWGgudkM+wJ4i8ZkCiykFPXp4qYRwt5UbPZiV4qr/t2qyZFAyLkHtTt6\nV4yQroudlBaoLepT5jh8ta4fFMLGPX80200K3t3r6uEmbvGJABSZwmcDVlJW\noFgr\r\n=M6GK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCL9XfMf/EZe0A8VYgysPmAqsidu87MNr05uMxGBC7ikQIhALPIQJRvzXS97GMZn7EEOUZWi/p8V7czriPbWZ4xYcgz"}]},"maintainers":[{"name":"alexaegis","email":"alexaegis@gmail.com"}],"_npmUser":{"name":"alexaegis","email":"alexaegis@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jwt_10.2.2_1601463860593_0.5835917272204723"},"_hasShrinkwrap":false},"11.0.0":{"name":"@aegis-auth/jwt","description":"Angular JWT authentication library","version":"11.0.0","license":"MIT","author":{"name":"AlexAegis","email":"alexaegis@gmail.com","url":"https://www.github.com/AlexAegis"},"homepage":"https://github.com/AlexAegis/auth/tree/master/libs/jwt#readme","repository":{"type":"git","url":"git+https://github.com/AlexAegis/auth.git"},"bugs":{"url":"https://www.github.com/AlexAegis/auth/issues"},"keywords":["ng","angular","jwt","token","auth","authentication","rxjs","reactive","interceptor","ts","typescript","js","javascript"],"peerDependencies":{"@angular/common":"11.*.*","@angular/core":"11.*.*","@angular/router":"11.*.*","rxjs":"6.6.*"},"dependencies":{"js-base64":"^3.6.0","tslib":"2.*.*"},"main":"bundles/aegis-auth-jwt.umd.js","module":"fesm2015/aegis-auth-jwt.js","es2015":"fesm2015/aegis-auth-jwt.js","esm2015":"esm2015/aegis-auth-jwt.js","fesm2015":"fesm2015/aegis-auth-jwt.js","typings":"aegis-auth-jwt.d.ts","metadata":"aegis-auth-jwt.metadata.json","sideEffects":false,"_id":"@aegis-auth/jwt@11.0.0","_nodeVersion":"14.15.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-BDxATC6yfGZpNBFMAdVyunvAVwqsXhEKqLD1WyANWR2PisaWAJwEkz8pGaDvDfSfGgy9xgiromLvroWLOx9CFg==","shasum":"31b316b377d4a28269bd849655c0c69322c1e8ff","tarball":"https://registry.npmjs.org/@aegis-auth/jwt/-/jwt-11.0.0.tgz","fileCount":160,"unpackedSize":631578,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfuY7wCRA9TVsSAnZWagAANO8P/3cYSeBExiU2eUlrl0wI\noAOGRW0WgWgN/A7dq03oENs3W+t+RkpthZ+TGri6UpiaEDgCTeclC85aTmQT\nxG3j80yO3Y0qQIJKYA4sQJxuNs4u0YJY4vCs4lBY4gKO1+q49hWY0TmtaNtZ\neWvkFF4DsuzEq6FxA1MUUxcKSVmCKAU1B90PGkQ80Zq8QCy40XoARpEvDcz2\nhz1KYnEjfzfWA757DFueXSyHjbSq2LkTmq7Z+tFcLmOjx5d/vSaTsCkwsAi8\n6x2BI5aW3h4csZQe9zDe1w7ztFD5Uu+syWI/z2n9Arh4wKOW/dzpQ61wtTqy\njEtQPYMxH0IEw60bpifmdEvLwvdkgtZ2DkAI+bS5VugTlM3UcMKbJgFKKRvA\nwj7VALbPMLIHL38FWjoU+z/eHJIfgBm5zhWXQhakM58sDXw8AtbIWZzx3gjw\nDi1c5QrBVHmxN93gAEZB2P3PYzcDDQBkG8LfniQU8YeYs1EyeibIJQts74mb\nrR1uWG84JXrbB2O4PUFmgthMNOkIMkEqQ0XjYHm5L1wvBKAuxnupL8aBGoMg\n0OU0ALz6Rk2l0V+MZmG3a6fbzTvQPyAhVrESjAEA3iY2izCg3erH/geO9y7Q\nbrhNFaU+IqsrNLXWQNLzCvpXS9ctXhhddbURxuCH4NGSlOE0Uq5wB52aQjdA\nz7aR\r\n=O37u\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC+4Z02QuUhQPureD1zt26bVQgi8pyaR2C/OkNuz5XyLwIhAMMxAQbvUp8/fDWwN6fVYRBzyQWHttmdpB4OAGLWUhXB"}]},"_npmUser":{"name":"alexaegis","email":"alexaegis@gmail.com"},"directories":{},"maintainers":[{"name":"alexaegis","email":"alexaegis@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jwt_11.0.0_1605996271502_0.438110288172721"},"_hasShrinkwrap":false},"11.0.1":{"name":"@aegis-auth/jwt","description":"Angular JWT authentication library","version":"11.0.1","license":"MIT","author":{"name":"AlexAegis","email":"alexaegis@gmail.com","url":"https://www.github.com/AlexAegis"},"homepage":"https://github.com/AlexAegis/auth/tree/master/libs/jwt#readme","repository":{"type":"git","url":"git+https://github.com/AlexAegis/auth.git"},"bugs":{"url":"https://www.github.com/AlexAegis/auth/issues"},"keywords":["ng","angular","jwt","token","auth","authentication","rxjs","reactive","interceptor","ts","typescript","js","javascript"],"peerDependencies":{"@angular/common":"11.*.*","@angular/core":"11.*.*","@angular/router":"11.*.*","rxjs":"6.6.*"},"dependencies":{"js-base64":"^3.6.0","tslib":"2.*.*"},"main":"bundles/aegis-auth-jwt.umd.js","module":"fesm2015/aegis-auth-jwt.js","es2015":"fesm2015/aegis-auth-jwt.js","esm2015":"esm2015/aegis-auth-jwt.js","fesm2015":"fesm2015/aegis-auth-jwt.js","typings":"aegis-auth-jwt.d.ts","metadata":"aegis-auth-jwt.metadata.json","sideEffects":false,"_id":"@aegis-auth/jwt@11.0.1","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-JysqtXBLQGKZNGUdJ7+5UE6GN6eI+CrmpnsSx3uIY1yUoYAtkYVEFylGIpXij+7LT83xh7Lfb1piSwCbxCaRcA==","shasum":"d0cb37bfc0243df0d15c12782020574edadfc842","tarball":"https://registry.npmjs.org/@aegis-auth/jwt/-/jwt-11.0.1.tgz","fileCount":160,"unpackedSize":634243,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgT54ICRA9TVsSAnZWagAAveEP/10iGsQSmTjVyrkvNTiu\nyKRPPRcE/7VEY90ru96EfjNDKM2eAY0jzrQ2eFyOQrcw2F4UmpG+oiGAEuhD\nfcusNTZdqV3INgwTU8uCW2qKhlSVzYnSFyNXIQb17sZpKZA+qfse+3p0W6IG\nbhmcm7Gl8hLgNagU4iV+CB9UQNN7Lv9W19o87Koh5szkPTlSWGzH5pgOyvuh\nkhLNGzGgyLsmLZRSxnH1N15jCNCnlTMEgn8HuzlesWWYP3QLzLcOukuksgKB\nRvVWP8e/wUuI5nMDabzvI7SlPs8Kc2F4yDhRI/xDrhb6Ck07YY3OGD+po6Os\noFtWNH1PK2EsZJOAmy0G0iopQdeuDXG8dQnBWcqqHMvAoaU25imnwIwbaE7T\neMqYTTmIjQkJh3R8rkul3C0CELoGRRggEVIWM+xyad0QsxaRXzDpSnnJWEW2\n1YiP0Y/Jn0ySMoOdSUk+c0tEi1j4bvLtMAY5jWvXAycCswr0W0Dwb8DbhuZH\n2870I3raLDMFQrKNEQIuTXH1vowmoiXK3QuXlfgzWTNuB70bMaoY/hELAm6/\ncXwEqSP/Hx8+65HzvwjMHvtBhdqlAvL2VxC1FXgMdzF5KFXwSxEEp1wGMc/Q\nEexxdgkmFflIMhZuYefwXnF4V/65BB3Hkpe0TaEz8rDQuv7lo4L0upmP8XCv\n6jdK\r\n=IDP9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDV2T94c+qGumlPLRxp3luNxu+2x3fOUZTVhEON3S9y4gIhAIpuyZ7UGz2LogTxYjgVLvswReDKtvy3n2F4Pwj8D2xD"}]},"_npmUser":{"name":"alexaegis","email":"alexaegis@gmail.com"},"directories":{},"maintainers":[{"name":"alexaegis","email":"alexaegis@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jwt_11.0.1_1615830536396_0.961272887129512"},"_hasShrinkwrap":false},"11.1.0":{"name":"@aegis-auth/jwt","description":"Angular JWT authentication library","version":"11.1.0","license":"MIT","author":{"name":"AlexAegis","email":"alexaegis@gmail.com","url":"https://www.github.com/AlexAegis"},"homepage":"https://github.com/AlexAegis/auth/tree/master/libs/jwt#readme","repository":{"type":"git","url":"git+https://github.com/AlexAegis/auth.git"},"bugs":{"url":"https://www.github.com/AlexAegis/auth/issues"},"keywords":["ng","angular","jwt","token","auth","authentication","rxjs","reactive","interceptor","ts","typescript","js","javascript"],"peerDependencies":{"@angular/common":"^11.0.0","@angular/core":"^11.0.0","@angular/router":"^11.0.0","rxjs":"^6.0.0"},"dependencies":{"js-base64":"^3.6.0","tslib":"^2.0.0"},"main":"bundles/aegis-auth-jwt.umd.js","module":"fesm2015/aegis-auth-jwt.js","es2015":"fesm2015/aegis-auth-jwt.js","esm2015":"esm2015/aegis-auth-jwt.js","fesm2015":"fesm2015/aegis-auth-jwt.js","typings":"aegis-auth-jwt.d.ts","metadata":"aegis-auth-jwt.metadata.json","sideEffects":false,"_id":"@aegis-auth/jwt@11.1.0","_nodeVersion":"14.16.1","_npmVersion":"7.11.2","dist":{"integrity":"sha512-PEmixMt3e1NUO3FWasi4T8axVh6nWfP5lxZmwZFjTC1Fv+PUHzfkcF/8b/lagmAZRIh/cfSmlF03S4vbRAl8dQ==","shasum":"01c153ff60c0ffe22d8332c1d2264dad8e7ebdff","tarball":"https://registry.npmjs.org/@aegis-auth/jwt/-/jwt-11.1.0.tgz","fileCount":169,"unpackedSize":665990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgkHfCCRA9TVsSAnZWagAAumkP/irK6Dcl8WJl/6Rj6GQQ\nQHcBEyKHjJP9Ulj1Yv7L0A7tcQFdhMtaK+scJsvV6GHVazrKO5SBRGkmphYm\nO9lXooTq/LEOXmro6Xw2+sQYuJfWiqsdrJFSXkYzRMSZ1Yk5fU9HavehNJA9\nuV4WINMT53CLhFi1t8tVlBYuH2dqfvC7h5heOJPDWK+lJSJ7D+YC/BpbSY4c\njyxkMwkeAFOj3+R+ktKIUuAbDN9PSnkRLSVsYTVzN1jSDoTrQoNsEBX8fsBO\nQLFA+dnHZ/kF3zCUNm7350Q5kBoiJqXVt68/HW6px1Rfiy1nCGdy01wwimt8\ncbOmk1X4Z39Y03VJ7NqgJx0meiZyN+HeJ1xupnrFB4cC/CpjlgHPiy2neBXh\nRfVg6lbiklrPeC99Enp+Swhl5q/Qy4zvfGthnMQnnUXtbhS3tSaBhaLR5DMQ\nHC+xYlK5m4dAlwPW+oLsuBtsLedBuh85Jgr34Q1O6m3eIo9NI+PI7wb0+oJn\n9onW8dEqQy5AtXklQjHtgFisGucNd9VDem4altXXlIZu/cpVDvFruWOD9E0w\nuvvbwmGWrR/Nitm1YH0THJDxpTLX7D/NBOhmuch74kwWMun70QmvVehvvycO\njHOi7wYHAm7EIbYDUE2PaiqgY37usAs/r4Fw20JmGTeyr2+KWMFjGrQ52Fbv\nadad\r\n=lAKc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDrZVupEwja5CB0QnL2u16LVa78HLo/IRBt3fAKBp00DwIhAPPvjbqHv9RfZpZwWqcq1apTMg1kvUUeM5BktWlroYaY"}]},"_npmUser":{"name":"alexaegis","email":"alexaegis@gmail.com"},"directories":{},"maintainers":[{"name":"alexaegis","email":"alexaegis@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jwt_11.1.0_1620080577735_0.927825590355636"},"_hasShrinkwrap":false},"12.0.0":{"name":"@aegis-auth/jwt","description":"Angular JWT authentication library","version":"12.0.0","license":"MIT","author":{"name":"AlexAegis","email":"alexaegis@gmail.com","url":"https://www.github.com/AlexAegis"},"homepage":"https://github.com/AlexAegis/auth/tree/master/libs/jwt#readme","repository":{"type":"git","url":"git+https://github.com/AlexAegis/auth.git"},"bugs":{"url":"https://www.github.com/AlexAegis/auth/issues"},"keywords":["ng","angular","jwt","token","auth","authentication","rxjs","reactive","interceptor","ts","typescript","js","javascript"],"peerDependencies":{"@angular/common":"^12.*.*","@angular/core":"^12.*.*","@angular/router":"^12.*.*","rxjs":"7.*.*"},"dependencies":{"js-base64":"^3.7.0","tslib":"2.*.*"},"main":"bundles/aegis-auth-jwt.umd.js","module":"fesm2015/aegis-auth-jwt.js","es2015":"fesm2015/aegis-auth-jwt.js","esm2015":"esm2015/aegis-auth-jwt.js","fesm2015":"fesm2015/aegis-auth-jwt.js","typings":"aegis-auth-jwt.d.ts","metadata":"aegis-auth-jwt.metadata.json","sideEffects":false,"gitHead":"9d8281384fad5f086a98d03e21bfeff73e371ed5","_id":"@aegis-auth/jwt@12.0.0","_nodeVersion":"14.19.1","_npmVersion":"7.24.2","dist":{"integrity":"sha512-2P1bkijFRTgBb2J6zZ4uiyHxKRGAWyjjm2dPw3n9YQFj5B/Jnph9LcbSixx5gbyykC0BVfgGm8hqWCbKiT6Lrw==","shasum":"39b3d1a78eeabf420ff2ce27c857ed8ca330e3c3","tarball":"https://registry.npmjs.org/@aegis-auth/jwt/-/jwt-12.0.0.tgz","fileCount":167,"unpackedSize":554567,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD6KRwMrp6+o6pip1XEm+8gH5450kPMUFEMeJUFmjmNuAIhAI6rdPbsWjixTuA9AgJjm+gpRacWnxGGI8XJ7EzMnGpT"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJicD8RACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpOFQ//cN1zuW3KQ/kKQg+FkK+Xf2y26HV1yAZr9qX0vrgH7giFwHrj\r\nUyLWgU/ZQGeQ+xClKlyLaW/2KW/zV7YnhLOGT0YadHN9BqvrzwJROXzQOSJZ\r\n/vh2gJNp6wKUloBeLfEGC2SP6AlQZ0Iowj1LZvDGMnXd6KJKgN9JuqvTlK3M\r\nQJgflhEV7utnnRkImRr++ZK25xuZ8juh8T7Q3dmzfUjNkkaWKoL4cK00Uay0\r\nPSX8WJlLib2lU8yJ2aIeP8I1/8UQbmszewpcWtmq3vTHUNVnxdSNgO7Cz/vG\r\np71v0nI+1aZ2H89IYCF5x/mF2GXoPXXDIWSo/LQOVc49rXeTQdDA/IrwTGxq\r\njVpXqXK0IdtCHNQL6Qw8UXcZJ06GVqnU7psprEYt+ho8OSAL8bsn9pS3IK0H\r\nMz8ZpHMVgdMMvVbqC6r43gufMpDLe/dHxGtx3/2jRM1pYddGEwmYs3gOASCI\r\nFEmEk2g8HzcOyqIDBOXbUh5fSKnsavAca882LitZCWHymNe6qo9Cpj3L9aMV\r\nnI3xAkeBwSDBIfN7LRwQ2R/3f7hyqgOvea9WPTzXWQZUhSH1OnxqbXMPCK7r\r\nq5RZ1tcaPO7igXfLY34m38kfjjLmTMZuKST7Obn/jUx/7Ef6zmhVOP3d1rRP\r\ny+Ng7q/JRYNrvvtsgDoPib0BvXjJn8sej5k=\r\n=RNv0\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"alexaegis","email":"alexaegis@gmail.com"},"directories":{},"maintainers":[{"name":"alexaegis","email":"alexaegis@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jwt_12.0.0_1651523345319_0.9712677653661816"},"_hasShrinkwrap":false},"13.0.0":{"name":"@aegis-auth/jwt","description":"Angular JWT authentication library","version":"13.0.0","license":"MIT","author":{"name":"AlexAegis","email":"alexaegis@gmail.com","url":"https://www.github.com/AlexAegis"},"homepage":"https://github.com/AlexAegis/auth/tree/master/libs/jwt#readme","repository":{"type":"git","url":"git+https://github.com/AlexAegis/auth.git"},"bugs":{"url":"https://www.github.com/AlexAegis/auth/issues"},"keywords":["ng","angular","jwt","token","auth","authentication","rxjs","reactive","interceptor","ts","typescript","js","javascript"],"peerDependencies":{"@angular/common":"13.*.*","@angular/core":"13.*.*","@angular/router":"13.*.*","rxjs":"7.*.*","@angular/platform-browser-dynamic":"13.3.5"},"dependencies":{"js-base64":"^3.7.0","tslib":"2.*.*"},"module":"fesm2015/aegis-auth-jwt.mjs","es2020":"fesm2020/aegis-auth-jwt.mjs","esm2020":"esm2020/aegis-auth-jwt.mjs","fesm2020":"fesm2020/aegis-auth-jwt.mjs","fesm2015":"fesm2015/aegis-auth-jwt.mjs","typings":"aegis-auth-jwt.d.ts","exports":{"./package.json":{"default":"./package.json"},".":{"types":"./aegis-auth-jwt.d.ts","esm2020":"./esm2020/aegis-auth-jwt.mjs","es2020":"./fesm2020/aegis-auth-jwt.mjs","es2015":"./fesm2015/aegis-auth-jwt.mjs","node":"./fesm2015/aegis-auth-jwt.mjs","default":"./fesm2020/aegis-auth-jwt.mjs"}},"sideEffects":false,"gitHead":"34c9ce27075515fd39a9bf2718f72413dd934c6e","_id":"@aegis-auth/jwt@13.0.0","_nodeVersion":"14.19.1","_npmVersion":"8.8.0","dist":{"integrity":"sha512-mg9LIa4eSx4Ok8ZqCex+PGSGfNdz4EHzDSiIWLd1dHZX/8aBnPTRNeRdxyJa/tsXu36mMacijAYargtzLFgLGA==","shasum":"1118d4a08ce19a8f9c6aec162aeb2d005a0ce7dc","tarball":"https://registry.npmjs.org/@aegis-auth/jwt/-/jwt-13.0.0.tgz","fileCount":82,"unpackedSize":509303,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDCbPZYmmL1J8M8EqSUgNxsrwCPFPCEG+CxQIPKJP122AIhAO6wFpYhq5X+RdFCizvqvCu/AzTq7gkSSvZVCmVEZS64"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJicFuSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo8ZRAAiaHTYcwavdlLgqu5aRkH+HcN0EeEXpRQAgFMHFJA4uAC70zc\r\nLb1UNoXGH5z+Jxg1S6YoF3Q3OF61T7sIFmbn3uiZ4Oq+o6HRs8VIjaEPDGsg\r\nJFGKkOO1D5PIIgHM8+cMN89oML9NPChfIwCA4H5WYgWFvdBiiHMnqAoIqhMZ\r\nNnv2/jBwA8GLYrOoJOd+lvvQD0iVBzEpxulbjfFR5Inoad77MNeX1wv4qMy4\r\n0h28dRVhFMnUNtw5dCXGX02cCdTIiwIV64l9JKxyZnOxZ2N+hrZBDVO52VYq\r\nDGsMkk3XTJN7aA6PVwXjYzLyN7Qd50fhkKUkzDaqsaVGxtEi8pB5NLLTjkHN\r\n1H/jyymHxyewjwTVWbz18oWTPQ9uGH880iNZEm2JozIvACz5nakOaD6ToHqE\r\nokTtkksyHZoI2UhwuQ0DD1LRVy2tXXgppHFBnPEiNpAjNo4HzzdFYhx/2g0N\r\na2zMn4/0vVKAr36flpRyz2dOGXS13qrS+N/WGICuYu9P8nb7zH5BF7OOcy7Y\r\n8MBuXV87fwS3w6Rlx5SWUo+K3SaH2ThTd2YhqsC07T96ryhUH9KBrsJx31pC\r\nG5S0I2uWjy/2bSgWgQAutRXzmlYr+mjRUicO+17XXEWc/CKYmO9IK48lR50K\r\n85JzRjPfMUKFG7yTw6WEqc+hihs4LRIzr4U=\r\n=DpBU\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"alexaegis","email":"alexaegis@gmail.com"},"directories":{},"maintainers":[{"name":"alexaegis","email":"alexaegis@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jwt_13.0.0_1651530642002_0.8394780578188068"},"_hasShrinkwrap":false},"14.0.0":{"name":"@aegis-auth/jwt","description":"Angular JWT authentication library","version":"14.0.0","license":"MIT","author":{"name":"AlexAegis","email":"alexaegis@gmail.com","url":"https://www.github.com/AlexAegis"},"homepage":"https://github.com/AlexAegis/auth/tree/master/libs/jwt#readme","repository":{"type":"git","url":"git+https://github.com/AlexAegis/auth.git"},"bugs":{"url":"https://www.github.com/AlexAegis/auth/issues"},"keywords":["ng","angular","jwt","token","auth","authentication","rxjs","reactive","interceptor","ts","typescript","js","javascript"],"peerDependencies":{"@angular/common":"14.*.*","@angular/core":"14.*.*","@angular/router":"14.*.*","rxjs":"7.*.*","@angular/platform-browser-dynamic":"14.0.4"},"dependencies":{"js-base64":"^3.7.0","tslib":"2.*.*"},"module":"fesm2015/aegis-auth-jwt.mjs","es2020":"fesm2020/aegis-auth-jwt.mjs","esm2020":"esm2020/aegis-auth-jwt.mjs","fesm2020":"fesm2020/aegis-auth-jwt.mjs","fesm2015":"fesm2015/aegis-auth-jwt.mjs","typings":"index.d.ts","exports":{"./package.json":{"default":"./package.json"},".":{"types":"./index.d.ts","esm2020":"./esm2020/aegis-auth-jwt.mjs","es2020":"./fesm2020/aegis-auth-jwt.mjs","es2015":"./fesm2015/aegis-auth-jwt.mjs","node":"./fesm2015/aegis-auth-jwt.mjs","default":"./fesm2020/aegis-auth-jwt.mjs"}},"sideEffects":false,"gitHead":"517e9326b6f8fcdc9198634f22380cbb2d4c72b9","_id":"@aegis-auth/jwt@14.0.0","_nodeVersion":"14.19.3","_npmVersion":"8.13.2","dist":{"integrity":"sha512-PW+Qunc5zTAgIkyAgNso0issO9QeGHlnOX+6QgiwJ1wGLR7x26ng7AXCnT8+t6WFu/piN7FtkSsX+gkexBjQhw==","shasum":"39f7d9e5fdb575a5d692dfb91929b8900f0b65a3","tarball":"https://registry.npmjs.org/@aegis-auth/jwt/-/jwt-14.0.0.tgz","fileCount":81,"unpackedSize":509272,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC6WWcmlExoksjYTWLO7PSjbTudmIGAhqe8CiQqNXG+qwIgEpnzM8n+v2EUaztsd0hoSZKrbtDGJfgPO0p+FwTY7NY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJivp8vACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrblg//WMJMj/AGOZjKun4c9GmO9uy0DJ6uAG8h8HtO5B5xyUgtEyyM\r\nBfiU6w9RqUCxSxg7Ai8UbvdpP3k4X7zn65c83X98oDPqFFDhkvhWZ44lSKaJ\r\n7xUBt0va2RPNEdf8bYlkPHZ4AVnDM8gjLAzATXSliyZEqaDGuawi2DH4mrxw\r\nOtnYy3tf2zEGO5PCQD1eRJyHTZh8yksld62GGs5oNmW2rDosHkGVWoCkja/h\r\nYcJ/ssIMhL/SGdTMoThwAlVAUlgfIFQIuhdIkb5RQ8NP9ClUFhMTvoideyqf\r\nCbSOB2xsPRWBu0YoxJ/yR+2NMGerzZkuEIU6PozC9fsCXOBVVy1cAK4C7OTg\r\nEoaxZnfNTtAFJbgecn5rEwdfBpAtDElFxxspo9QxtGwcr2oRuqeeZuetEeHc\r\neCFALm8q8Oc2sTQ7C0SqgPJPx7Ah2ZSB7eHQHS8UKmgZ0d14/xDjE7qEHtaV\r\nUXUgPcE98AEEJvFQHQ4LkygqN0MoMikO+GdC1xAlfKeoQOadOIRVJk3trbDU\r\ncaWJAMXrQLjHPyBkJu+O/7nJaAKu/xJ0cUWQPtkOZksC/wDgdz1GnQVhY5j3\r\n722IcsmWX9GJNq0qG1J8vvjz9qKl1SeGbfVVtkoMwxYjzGyQB68zuNkM6Wwo\r\nqrQDOrXb0mqXuuZ0qnw2RpTR1uVfJ3hwKBs=\r\n=Pt32\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"alexaegis","email":"alexaegis@gmail.com"},"directories":{},"maintainers":[{"name":"alexaegis","email":"alexaegis@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jwt_14.0.0_1656659759431_0.07771803570078095"},"_hasShrinkwrap":false},"15.0.0":{"name":"@aegis-auth/jwt","description":"Angular JWT authentication library","version":"15.0.0","license":"MIT","author":{"name":"AlexAegis","email":"alexaegis@gmail.com","url":"https://www.github.com/AlexAegis"},"homepage":"https://github.com/AlexAegis/auth/tree/master/libs/jwt#readme","repository":{"type":"git","url":"git+https://github.com/AlexAegis/auth.git"},"bugs":{"url":"https://www.github.com/AlexAegis/auth/issues"},"keywords":["ng","angular","jwt","token","auth","authentication","rxjs","reactive","interceptor","ts","typescript","js","javascript"],"peerDependencies":{"@angular/common":"14.*.*","@angular/core":"14.*.*","@angular/router":"14.*.*","rxjs":"7.*.*","@angular/platform-browser-dynamic":"15.0.2"},"dependencies":{"js-base64":"^3.7.0","tslib":"2.*.*"},"module":"fesm2015/aegis-auth-jwt.mjs","es2020":"fesm2020/aegis-auth-jwt.mjs","esm2020":"esm2020/aegis-auth-jwt.mjs","fesm2020":"fesm2020/aegis-auth-jwt.mjs","fesm2015":"fesm2015/aegis-auth-jwt.mjs","typings":"index.d.ts","exports":{"./package.json":{"default":"./package.json"},".":{"types":"./index.d.ts","esm2020":"./esm2020/aegis-auth-jwt.mjs","es2020":"./fesm2020/aegis-auth-jwt.mjs","es2015":"./fesm2015/aegis-auth-jwt.mjs","node":"./fesm2015/aegis-auth-jwt.mjs","default":"./fesm2020/aegis-auth-jwt.mjs"}},"sideEffects":false,"gitHead":"8559a931927a50b887a09beab293b7ad243c707f","_id":"@aegis-auth/jwt@15.0.0","_nodeVersion":"14.21.1","_npmVersion":"8.19.3","dist":{"integrity":"sha512-JtIZb887hYlZtxlopFx1h3Hb9dFATgYi+fMXmSaDM/ZYtjK7VyMmQmZNjiYKAebhYjU3bYgscg5qYv1sf5eu3A==","shasum":"18a70192ed936372b4ecd62026610b64116e3019","tarball":"https://registry.npmjs.org/@aegis-auth/jwt/-/jwt-15.0.0.tgz","fileCount":81,"unpackedSize":509250,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFVYd8Fs4SDq7U0TF9e4hk1wqShxtZkzn1x4EJooQvPXAiBgOzM/iBiQPTL5pwjYuF75wj2OKaP3ob8Koqt94Tg+PA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjiRODACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr+6hAAjt3/F03T1fdESqfv70IZSjNo1PopUn1FoAhr4KlEIKxB9mBn\r\n9Rwu5hAdG1QZSblm9SLT9js02Xkar7BCROcDtF+GQK4tL9hnYjw4aPm56Lrm\r\nJ6VeegT/mcHNl1OX4fecLi5ff1GfbiLh/9rsaQkhbQUaOfvtCDxbQ0gr5b77\r\nONhsuE/9tHT0lPv+j5td+FYay2VFMhJfaAqYghyeY3TOB+KP75YtHP8ie4GJ\r\ncPrBKtbYFHJjr1c/8mPnXc4itbJ+9Cxw/BHKQVqife6/FMN7t1dYNc9qjG8q\r\n3oFbCZnZdBHUEHxooIH56m3zg5ZFzztcOHVXoOXo1eVaIVMhX53LvteV8ang\r\nTyRPGF8CK6f/fh6G30FPjFmY2tJ9bJSXuFPKYFdxdz57PaoTs0ZmkNA/x/IF\r\nNv9frvicXdwEdB5N9f1VU6vv/wtC4ZmrXbmDsZmjY0SaYdP7alwo296xctfe\r\nwcie4J1wk5udZv+Cphee/EKJ1IcJdiUMuSrP7+t2qKa9+aAO33cikZdow46k\r\nn3Gg5VPkH8iyd3ifnw4UTwNbwWdg/5pIcXsgZUpF13T2INXyb5AaB7xCIiUU\r\ngCyg2JqSiU5/bACUucMjNZ4tmAzQ0fvW0PN5YKtYbTPqgfWt1D5OCemnoicZ\r\n/UXkTq9QlgJSEHjeWFaEJNdMaskvFyM7W14=\r\n=2T0I\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"alexaegis","email":"alexaegis@gmail.com"},"directories":{},"maintainers":[{"name":"alexaegis","email":"alexaegis@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jwt_15.0.0_1669927810954_0.2950177117196884"},"_hasShrinkwrap":false},"16.0.0":{"name":"@aegis-auth/jwt","description":"Angular JWT authentication library","version":"16.0.0","license":"MIT","author":{"name":"AlexAegis","email":"alexaegis@pm.me","url":"https://www.github.com/AlexAegis"},"homepage":"https://github.com/AlexAegis/auth/tree/master/libs/jwt#readme","repository":{"type":"git","url":"git+https://github.com/AlexAegis/auth.git"},"bugs":{"url":"https://www.github.com/AlexAegis/auth/issues"},"keywords":["ng","angular","jwt","token","auth","authentication","rxjs","reactive","interceptor","ts","typescript","js","javascript"],"peerDependencies":{"@angular/common":"14.*.*","@angular/core":"14.*.*","@angular/router":"14.*.*","rxjs":"7.*.*","@angular/platform-browser-dynamic":"16.2.12"},"dependencies":{"js-base64":"^3.7.0","tslib":"2.*.*"},"module":"fesm2022/aegis-auth-jwt.mjs","typings":"index.d.ts","exports":{"./package.json":{"default":"./package.json"},".":{"types":"./index.d.ts","esm2022":"./esm2022/aegis-auth-jwt.mjs","esm":"./esm2022/aegis-auth-jwt.mjs","default":"./fesm2022/aegis-auth-jwt.mjs"}},"sideEffects":false,"_id":"@aegis-auth/jwt@16.0.0","gitHead":"6fb4cb55e99c3691c328fb3ef1baa0bba0ebfa1a","_nodeVersion":"20.11.1","_npmVersion":"10.2.4","dist":{"integrity":"sha512-A4Ze5QvYU4drZHllG5N0rYnCCZkfbkGu2zokn08oOa6Ztvxcx1iR3nWQCUmxXbwYHM/w8+UCHuXu7mbybrektA==","shasum":"0192fb11e8089094d460bf7108e6e66f019b4967","tarball":"https://registry.npmjs.org/@aegis-auth/jwt/-/jwt-16.0.0.tgz","fileCount":79,"unpackedSize":374561,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHDkZqqLU3BXpAbnLaSYPgmytEcUoOZV0cokx7smpS5OAiBSebOtLIQQJ3c1jHvpbVIjKNSf/R8vMEEkiP2tDtcUhg=="}]},"_npmUser":{"name":"alexaegis","email":"alexaegis@pm.me"},"directories":{},"maintainers":[{"name":"alexaegis","email":"alexaegis@pm.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jwt_16.0.0_1711223856234_0.6269811732570052"},"_hasShrinkwrap":false},"15.0.1":{"name":"@aegis-auth/jwt","description":"Angular JWT authentication library","version":"15.0.1","license":"MIT","author":{"name":"AlexAegis","email":"alexaegis@gmail.com","url":"https://www.github.com/AlexAegis"},"homepage":"https://github.com/AlexAegis/auth/tree/master/libs/jwt#readme","repository":{"type":"git","url":"git+https://github.com/AlexAegis/auth.git"},"bugs":{"url":"https://www.github.com/AlexAegis/auth/issues"},"keywords":["ng","angular","jwt","token","auth","authentication","rxjs","reactive","interceptor","ts","typescript","js","javascript"],"peerDependencies":{"@angular/common":"15.*.*","@angular/core":"15.*.*","@angular/router":"15.*.*","rxjs":"7.*.*","@angular/platform-browser-dynamic":"15.0.2"},"dependencies":{"js-base64":"^3.7.0","tslib":"2.*.*"},"module":"fesm2015/aegis-auth-jwt.mjs","es2020":"fesm2020/aegis-auth-jwt.mjs","esm2020":"esm2020/aegis-auth-jwt.mjs","fesm2020":"fesm2020/aegis-auth-jwt.mjs","fesm2015":"fesm2015/aegis-auth-jwt.mjs","typings":"index.d.ts","exports":{"./package.json":{"default":"./package.json"},".":{"types":"./index.d.ts","esm2020":"./esm2020/aegis-auth-jwt.mjs","es2020":"./fesm2020/aegis-auth-jwt.mjs","es2015":"./fesm2015/aegis-auth-jwt.mjs","node":"./fesm2015/aegis-auth-jwt.mjs","default":"./fesm2020/aegis-auth-jwt.mjs"}},"sideEffects":false,"gitHead":"cc722d89c0c611759f7161ccf9215e55a87f4242","_id":"@aegis-auth/jwt@15.0.1","_nodeVersion":"14.21.3","_npmVersion":"8.19.4","dist":{"integrity":"sha512-FblE8VYj6qsVjA9glPstU6Y1bny4I2zDy5LtzJYTlN2jQOsf/zAhLSBlXzeQD9cgL5N6mGKLJvcew8Eh2L5O8w==","shasum":"b0c21f1ee74b5047b17284896ddd737ce642b78e","tarball":"https://registry.npmjs.org/@aegis-auth/jwt/-/jwt-15.0.1.tgz","fileCount":81,"unpackedSize":509250,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCq0+eXzWiMMi2ifXCJSBYlOh2GYqdMLA5AY2VEbW2zkAIhAJ2eHjtcKYGEiKWhGPyaAN+4xqOCwrA/AvHBMUnCaIGx"}]},"_npmUser":{"name":"alexaegis","email":"alexaegis@pm.me"},"directories":{},"maintainers":[{"name":"alexaegis","email":"alexaegis@pm.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jwt_15.0.1_1711224650355_0.24812503751376092"},"_hasShrinkwrap":false},"16.0.1":{"name":"@aegis-auth/jwt","description":"Angular JWT authentication library","version":"16.0.1","license":"MIT","author":{"name":"AlexAegis","email":"alexaegis@pm.me","url":"https://www.github.com/AlexAegis"},"homepage":"https://github.com/AlexAegis/auth/tree/master/libs/jwt#readme","repository":{"type":"git","url":"git+https://github.com/AlexAegis/auth.git"},"bugs":{"url":"https://www.github.com/AlexAegis/auth/issues"},"keywords":["ng","angular","jwt","token","auth","authentication","rxjs","reactive","interceptor","ts","typescript","js","javascript"],"peerDependencies":{"@angular/common":"16.*.*","@angular/core":"16.*.*","@angular/router":"16.*.*","rxjs":"7.*.*","@angular/platform-browser-dynamic":"16.2.12"},"dependencies":{"js-base64":"^3.7.0","tslib":"2.*.*"},"module":"fesm2022/aegis-auth-jwt.mjs","typings":"index.d.ts","exports":{"./package.json":{"default":"./package.json"},".":{"types":"./index.d.ts","esm2022":"./esm2022/aegis-auth-jwt.mjs","esm":"./esm2022/aegis-auth-jwt.mjs","default":"./fesm2022/aegis-auth-jwt.mjs"}},"sideEffects":false,"_id":"@aegis-auth/jwt@16.0.1","gitHead":"db377cacfe2f7c7712122e6b7ad5f318f52985d5","_nodeVersion":"20.11.1","_npmVersion":"10.2.4","dist":{"integrity":"sha512-OKzj1ci93J/IEeBkE3FX0SBkbkPX/CpMyslOk8f9vd43iYAtJ19RY2mhnwC5RJXqO0nNrQ8UU7KK4hIHgyMrBA==","shasum":"b752e6521c3fb1c2824ce89c7622ed9fa58ee56c","tarball":"https://registry.npmjs.org/@aegis-auth/jwt/-/jwt-16.0.1.tgz","fileCount":79,"unpackedSize":374561,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDvg/g61wEPHYCmE7mNz2GTZZOHl7+9jLsLqYhaBuvAGwIgCEswSlUF2QI6HEwadoLdK3qLw7XoRUwHkV45wil49P8="}]},"_npmUser":{"name":"alexaegis","email":"alexaegis@pm.me"},"directories":{},"maintainers":[{"name":"alexaegis","email":"alexaegis@pm.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jwt_16.0.1_1711225116612_0.00780476824308618"},"_hasShrinkwrap":false},"17.0.0":{"name":"@aegis-auth/jwt","description":"Angular JWT authentication library","version":"17.0.0","license":"MIT","author":{"name":"AlexAegis","email":"alexaegis@pm.me","url":"https://www.github.com/AlexAegis"},"homepage":"https://github.com/AlexAegis/auth/tree/master/libs/jwt#readme","repository":{"type":"git","url":"git+https://github.com/AlexAegis/auth.git"},"bugs":{"url":"https://www.github.com/AlexAegis/auth/issues"},"keywords":["ng","angular","jwt","token","auth","authentication","rxjs","reactive","interceptor","ts","typescript","js","javascript"],"peerDependencies":{"@angular/common":"17.*.*","@angular/core":"17.*.*","@angular/router":"17.*.*","rxjs":"7.*.*"},"dependencies":{"js-base64":"^3.7.0","tslib":"2.*.*"},"module":"fesm2022/aegis-auth-jwt.mjs","typings":"index.d.ts","exports":{"./package.json":{"default":"./package.json"},".":{"types":"./index.d.ts","esm2022":"./esm2022/aegis-auth-jwt.mjs","esm":"./esm2022/aegis-auth-jwt.mjs","default":"./fesm2022/aegis-auth-jwt.mjs"}},"sideEffects":false,"_id":"@aegis-auth/jwt@17.0.0","gitHead":"714505b5c17636299b50a78ed863749536ca51d8","_nodeVersion":"20.11.1","_npmVersion":"10.2.4","dist":{"integrity":"sha512-Oyn+45EqEluWBmq11lty7V/WRAFrkhhZdNmKf/0Q7m0mkTmfdmX07xWETaZlM7EJrYG6eswBNrEM7VUxks+nNA==","shasum":"60156c6fc836f9773bd8dac2d31b9dab5f3179be","tarball":"https://registry.npmjs.org/@aegis-auth/jwt/-/jwt-17.0.0.tgz","fileCount":79,"unpackedSize":374483,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCfhOUkhjslFHNVOFdHl8IfrxQmjRiNpvIVUwqr/HwIDwIhAKcgJ9E7t6fC2+ujJCsvsqZyWdzgRC+amKemVvlo6vyt"}]},"_npmUser":{"name":"alexaegis","email":"alexaegis@pm.me"},"directories":{},"maintainers":[{"name":"alexaegis","email":"alexaegis@pm.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jwt_17.0.0_1711226546320_0.35066960695306837"},"_hasShrinkwrap":false}},"time":{"created":"2020-06-14T22:08:43.936Z","0.0.1":"2020-06-14T22:08:44.417Z","modified":"2024-03-23T20:47:17.380Z","0.1.1":"2020-06-15T01:07:59.231Z","0.1.2":"2020-06-18T09:45:12.106Z","0.1.3":"2020-06-30T09:02:06.034Z","0.1.4":"2020-08-20T18:30:48.109Z","1.0.0":"2020-08-31T00:35:20.061Z","1.0.1":"2020-09-01T23:27:38.169Z","8.0.0":"2020-09-03T19:05:50.116Z","9.0.0":"2020-09-03T20:21:55.258Z","10.0.0":"2020-09-03T20:45:23.305Z","10.1.0":"2020-09-06T14:09:30.032Z","8.1.0":"2020-09-06T15:16:27.985Z","9.1.0":"2020-09-06T15:23:44.574Z","10.2.0":"2020-09-27T17:32:15.904Z","9.2.0":"2020-09-27T19:03:07.299Z","8.2.0":"2020-09-27T19:30:40.976Z","10.2.1":"2020-09-30T10:14:14.987Z","10.2.2":"2020-09-30T11:04:20.948Z","11.0.0":"2020-11-21T22:04:31.668Z","11.0.1":"2021-03-15T17:48:56.672Z","11.1.0":"2021-05-03T22:22:58.035Z","12.0.0":"2022-05-02T20:29:05.441Z","13.0.0":"2022-05-02T22:30:42.249Z","14.0.0":"2022-07-01T07:15:59.643Z","15.0.0":"2022-12-01T20:50:11.144Z","16.0.0":"2024-03-23T19:57:36.402Z","15.0.1":"2024-03-23T20:10:50.502Z","16.0.1":"2024-03-23T20:18:36.813Z","17.0.0":"2024-03-23T20:42:26.479Z"},"maintainers":[{"name":"alexaegis","email":"alexaegis@pm.me"}],"readme":"# jwt\n\n<!-- markdownlint-disable MD013 -->\n\n[![Latest NPM Version](https://img.shields.io/npm/v/@aegis-auth/jwt/latest)](https://www.npmjs.com/package/@aegis-auth/jwt/v/latest)\n\n<!-- markdownlint-enable MD013 -->\n\nHandles common JWT use-cases, like adding the access token to\nrequests **and automatically refreshing it when needed**.\n\nIt consists of a `JwtModule` with two configurable Interceptors, and a helper\nservice to access your parsed and typed tokens.\n\nIt also provides a way to handle cases where a refresh cannot happen\n(For example: both token expired) with a redirection (As thats the most\ncommon recovery method) or a completely custom function for more advanced\nuse-cases.\n\n## Installation\n\nUsing npm\n\n```sh\nnpm i @aegis-auth/jwt\n```\n\nUsing yarn\n\n```sh\nyarn add @aegis-auth/jwt\n```\n\n## Usage\n\nFor an example app visit the [jwt-demo](../../apps/jwt-demo) application.\nIt's small and simple.\n\n### Configuration\n\nThe heart of the library is the `JwtModule` and it's `forRoot` method which\nhelps you configure it's providers.\n\n#### Basic usage\n\nFor simple usecases, where you only want to have the access token injected\ninto your http headers, you only need to configure the first provider, like so.\n\n> The provider definitions in this project are typed! While configuring it\n> you will always have knowledge on what you can configure and how, right\n> there! There is JSDoc hint for each!\n\nThis is the simplest possible configuration, where you put your tokens into\nlocalstorage. Remember that the library will call **this `getToken`** function\nevery time it needs to use the token!\n\n```ts\nJwtModule.forRoot({\n  useValue: {\n    getToken: () => localStorage.getItem('accessToken'),\n  },\n});\n```\n\nI recommend using a `BehaviorSubject` in a service, so it can stay in memory,\nit still can be initialized from the `localStorage` and with a subscription\nyou can always save the changes.\n([Example](../../apps/jwt-demo/src/app/service/auth.service.ts))\n\nFor this, you would use a factory provider with this service as it's\ndependency:\n\n```ts\nJwtModule.forRoot({\n  useFactory: (authService: AuthService) => ({\n    getToken: authService.accessTokenStorage$,\n    domainWhitelist: ['localhost'],\n  }),\n  deps: [AuthService],\n});\n```\n\nConfiguring this provider causes an HTTP Interceptor to be activated. It will\nappend the acquired token in a configurable header on every request where it's\napplicable.\n\n##### Configuration options\n\n```ts\ninterface JwtConfiguration extends UrlFilter {\n  /**\n   * A callback or observable that will be called or subscribed to\n   * on every http request and returns a value for the header\n   *\n   * @example getValue: () => localstorage.get('foo')\n   * @example getValue: myTokenService.foo$\n   */\n  getToken:\n    | Observable<string | null | undefined>\n    | (() =>\n        | string\n        | null\n        | undefined\n        | Promise<string | null | undefined>\n        | Observable<string | null | undefined>);\n\n  /**\n   * The prefix of the token when injecting. Notice thet the trailing\n   * whitespace has to be set here\n   *\n   * @default 'Bearer '\n   */\n  scheme?: string;\n\n  /**\n   * Header name to be set\n   *\n   * @default 'Authorization'\n   */\n  header: string;\n\n  /**\n   * This callback is called when the request fails and there is no\n   * RefreshConfiguration, or when the access token is simply missing.\n   * `getToken` returned a nullish value. If the RefreshConfiguration is\n   * available, then the error handling continues in the same fashion on\n   * the other configuration.\n   *\n   * Both have the same names and signature for\n   * both the error handling configuration options `onFailure` and\n   * `onFailureRedirectParameters`, so if you wish to use the same for both\n   * implement them outside, and spread them back. You can use the\n   * `JwtErrorHandling` interface to help you with the typing. Although\n   * thats a bit wider when it comes to the error types.\n   *\n   * If it's a string, instead of calling it, a redirection will happen,\n   * with `onFailureRedirectParameters` as it's queryParams.\n   */\n  onFailure?: string | ((jwtError: JwtError) => void);\n\n  /**\n   * This option is only used when the `onFailure` option is a string\n   * so it's handled as a redirect. When this happens, you can define\n   * the queryparams to be used with this redirect.\n   */\n  onFailureRedirectParameters?:\n    | ((error: JwtError) => HttpParams | Params)\n    | HttpParams\n    | Params;\n}\n```\n\nThese properties are available on the configuration, and are used to control\nwhat Urls can or can not recieve the token\n\n```ts\ninterface UrlFilter {\n  /**\n   * These domains won't recieve this header even if they are listed in the\n   * whitelist.\n   *\n   * If `null` or `undefined`, this category of rules won't take any effect.\n   * If empty, it would mean \"No domains are blacklisted\", and it won't\n   * take any effect.\n   *\n   * @default undefined\n   * @example ['localhost:3333']\n   * @example [/localhost:[0-9]{4}/]\n   */\n  domainBlacklist?: (string | RegExp)[];\n\n  /**\n   * Only domains listed will be recieving header injections\n   *\n   * If `null` or `undefined`, this category of rules won't take any effect.\n   * If empty, it would mean \"No domains are whitelisted\", so no paths would\n   * recieve tokens!\n   *\n   * @default undefined\n   * @example ['localhost:3333']\n   * @example [/localhost:[0-9]{4}/]\n   */\n  domainWhitelist?: (string | RegExp)[];\n\n  /**\n   * These paths won't recieve this header even if they are listed in the\n   * whitelist.\n   *\n   * If `null` or `undefined`, this category of rules won't take any effect.\n   * If empty, it would mean \"No paths are blacklisted\", and it won't\n   * take any effect.\n   *\n   * @default undefined\n   * @example ['api/v2/users/1']\n   * @example [/users\\/.+/]\n   */\n  pathBlacklist?: (string | RegExp)[];\n\n  /**\n   * Only paths listed will be recieving this header injection.\n   *\n   * If `null` or `undefined`, this category of rules won't take any effect.\n   * If empty, it would mean \"No paths are whitelisted\", so no paths would\n   * recieve tokens!\n   *\n   * @default undefined\n   * @example ['api/v2/users/1']\n   * @example [/users\\/.+/]\n   */\n  pathWhitelist?: (string | RegExp)[];\n\n  /**\n   * These protocols won't recieve this header even if they are listed in\n   * the whitelist.\n   *\n   * If `null` or `undefined`, this category of rules won't take any effect.\n   * If empty, it would mean \"No protocols are blacklisted\", and it won't\n   * take any effect.\n   *\n   * @default undefined\n   * @example ['http']\n   * @example [/https?/]\n   */\n  protocolBlacklist?: (string | RegExp)[];\n\n  /**\n   * Only protocols listed will be recieving this header injections.\n   *\n   * If empty or undefined, this category of rules won't take any effect.\n   * If empty, it would mean \"No protocols are whitelisted\", so no protocols\n   * would recieve tokens!\n   *\n   * @default undefined\n   * @example ['http']\n   * @example [/https?/]\n   */\n  protocolWhitelist?: (string | RegExp)[];\n}\n```\n\n#### Refreshing usage\n\nYou can optionally configure a second provider. If you do, another HTTP\nInterceptor will make sure that if an endpoint that needs to recieve an\n`accessToken`, and the provided one is expired, it first visits the\nconfigured refresh endpoint, optionally refreshes your storage, and retries the\noriginally intended request with the newly acquired, fresh access token.\n\nIt can also do the same if the original token wasn't expired, but the server\nrejected it (For example, the server can have a blacklist mechanic on login).\nIt only retries once, and by default it only does the retry if the error\nstatus was `401`, Unauthorized.\n\n##### Refresh configuration options\n\nBecause handling refreshes is not standardized instead of asking for the\nrefresh token directly I ask you to provide the request itself, however you\nlike to. In these callbacks you can access your refreshToken wherever you\nstore it.\n\nThe reason it's configured through multiple properties instead of a callback\nwhere I let you do the refresh request however you see fit is to make sure the\nrefreshUrl is known to avoid potentional infinite requests when hitting the\nrefresh endpoint. This way you don't have to remember setting this into the\nurl filter manually.\n\n````ts\nexport interface JwtRefreshConfiguration<RefreshRequest, RefreshResponse>\n  extends UrlFilter,\n    HttpErrorFilter {\n  /**\n   * After a successful refresh, this callback will be called.\n   * You need to define a function which will save the the token in a way\n   * that if the interceptor calls `getToken` again, it will get the token\n   * saved with this method.\n   *\n   * @example using `localStorage`\n   *    setToken: (response) => localStorage.setItem('accessToken', response.accessToken)\n   * @example using a service.\n   *\n   * ```typescript\n   * AuthCoreModule.forRoot<TokenStorageService>({\n   *    useFactory: (service: TokenStorageService) => ({\n   *      getToken: service.accessToken$\n   *      autoRefresher: {\n   *         endpoint: `${environment.api}/auth/refresh`,\n   *         setRefreshToken: (response) => service.accessToken$.next(response.accessToken)\n   *       }\n   *    }),\n   *    deps: [TokenStorageService],\n   * })\n   * ```\n   *\n   */\n  setRefreshedTokens: (response: JwtRefreshResponse) => void;\n\n  /**\n   * The method for the request, usually it's a POST so that's the default\n   *\n   * @default 'POST'\n   */\n  method?: HttpMethodType;\n  /**\n   * The endpoint that will be requested for a new token\n   */\n  refreshUrl: string;\n  /**\n   * A callback or observable that can be used to retrieve the body of the\n   * request. If it's null or undefined, the refresh won't be executed. This\n   * can be utilized to not do a refresh on a logged out state.\n   *\n   * @example getValue: () => localstorage.get('foo')\n   * @example getValue: myTokenService.foo$\n   */\n  createRefreshRequestBody:\n    | Observable<RefreshRequest | null | undefined>\n    | (() =>\n        | RefreshRequest\n        | null\n        | undefined\n        | Promise<RefreshRequest | null | undefined>\n        | Observable<RefreshRequest | null | undefined>);\n  /**\n   * A callback that should return the defaults on the request\n   */\n  refreshRequestInitials?:\n    | (() => HttpRequestInit | undefined)\n    | HttpRequestInit;\n  /**\n   * This function have to transform the result of your refresh endpoint\n   * into a digestable form. It will be called after successful refreshes.\n   */\n  transformRefreshResponse: (response: RefreshResponse) => JwtRefreshResponse;\n\n  /**\n   * This callback is called when a refresh either failed or cannot be done.\n   * This marks the point where both tokens are invalid and the user needs to\n   * relog. Because this is usually done through a login page, aside from a\n   * regular callback, a string can also be supplied which will act as the\n   * target of navigation. Check `onFailureRedirectParameters` if you wish\n   * to supply query parameters. For more advanced usage, consider\n   * implementing it as a custom function, the error object is available\n   * there too!\n   */\n  onFailure?:\n    | string\n    | ((error: JwtCouldntRefreshError | JwtCannotRefreshError) => void);\n\n  onFailureRedirectParameters?:\n    | ((\n        error: JwtCouldntRefreshError | JwtCannotRefreshError\n      ) => HttpParams | Params)\n    | HttpParams\n    | Params;\n\n  /**\n   * Optional!\n   *\n   * Not used in the refresh mechanic! See `createRefreshRequestBody` if you\n   * need to provide the `refreshToken` in the body when making the refresh\n   * request or `refreshRequestInitials` when it's handled in a header!\n   *\n   * A callback or observable that can be used to retrieve the refresh token\n   * Not used in the interceptor! it is only used in the helper service if\n   * you with to interact with the parsed refreshToken throught the helper\n   * observables. If you do not, you don't have to implement this.\n   *\n   * @example getValue: () => localstorage.get('foo')\n   * @example getValue: myTokenService.foo$\n   */\n  getRefreshToken?:\n    | Observable<string | null | undefined>\n    | (() =>\n        | string\n        | null\n        | undefined\n        | Promise<string | null | undefined>\n        | Observable<string | null | undefined>);\n\n  /**\n   * When using the LoginGuard this setting will determine the default\n   * value. So instead of disabling the autoRefresh behavior on every\n   * route with the data option, or writing your own guard (Which would\n   * be really simple) just set this to false. You can still override it\n   * using route data.\n   *\n   * See the LoginGuardData helper interface to see what it can utilize.\n   *\n   * @default true\n   */\n  isAutoRefreshAllowedInLoginGuardByDefault?: boolean;\n}\n````\n\nAll options on the URLFilter are also available here too to further restrict\nwhat endpoint can be refreshed.\n\nAdditionally, it can filter on the return status of a failed request\n\n```ts\nexport interface HttpErrorFilter {\n  /**\n   * The error codes on which an act is allowed to happen,\n   * an empty array means it can't act on anything\n   *\n   * @default [401]\n   */\n  errorCodeWhitelist?: number[];\n\n  /**\n   * The error codes on which an act is not allowed to happen,\n   * an empty array (and if undefined) means it can always try a single\n   * act in case of an error\n   *\n   * @default undefined\n   */\n  errorCodeBlacklist?: number[];\n}\n```\n\n### The helper service\n\nThe provided\n[`JwtTokenService<Claims>`](./src/lib/service/jwt-token.service.ts) is a\nservice consisting of Observable pipelines all originating from the\ngetToken property in your configuration provided by you.\n\nThere are observables to acquire the raw tokens:\n\n- `rawAccessToken$: Observable<string | null | undefined>`\n- `rawRefreshToken$: Observable<string | null | undefined>`\n\nThe parsed tokens:\n\n- `accessToken$: Observable<JwtToken<Claims> | null>`\n- `refreshToken$: Observable<JwtToken<Claims> | null>`\n\nWhere `JwtToken<Claims>` is:\n\n```ts\nclass JwtToken<Claims extends {}> {\n  header: JwtTokenHeader, // Based on RFC 7519\n  payload: JwtTokenPayload & Claims, // Based on RFC 7519\n  signature: string,\n  isExpired: () => boolean\n}\n```\n\nThe headers:\n\n- `accessTokenHeader$: Observable<JwtTokenHeader | null>`\n- `refreshTokenHeader$: Observable<JwtTokenHeader | null>`\n\nThe payloads:\n\n- `accessTokenHeader$: Observable<(JwtTokenPayload & Claims) | null>`\n- `refreshTokenHeader$: Observable<(JwtTokenPayload & RefreshClaims) | null>`\n\nAnd if they are expired or not:\n\n- `isAccessTokenExpired$: Observable<boolean>`\n- `isRefreshTokenExpired$: Observable<boolean>`\n\nThe payload is used to carry custom claims. These can be defined by you and\npassed to the service on injection as a generic. Though often not used, the\nsecond generic allows to define the extra claims on the refresh token.\n\n```ts\nexport interface MyClaims {\n  username: string;\n}\n\nexport class MyService {\n  constructor(private readonly jwtTokenService: JwtTokenService<MyClaims>) {\n    this.jwtTokenService.accessToken$.pipe(\n      map((token) => token?.payload.username) // Here, `username` is a string\n    );\n  }\n}\n```\n\nRemember, that the helper service has to inject the configuration inside it,\nso if you would try to inject this service into any of the dependencies of the\nconfigurations provider of the JwtModule, you would get a cyclic dependency.\n\nBut since this helper servise does not contain any functions, you can't pass\nany more information to it. That means it can be used independently.\n\nIf you do need to use your original dependency and this helper service together\nI recommend making that original dependency into a simple storage with\n2 `BehaviorSubject`s, and making another service where you can inject both.\n\nIn the example application, the `AuthService` acts both as the storage of the\ntokens, and some methods on doing `login`, `refresh` and `logout`.\n\nThis demo `AuthService` only has to manage the token storage, the library\nwill always use the latest values.\n\n### The LoginGuard\n\nUsing the LoginGuard on a route means that the route and all of its children\ncannot open unless there is a valid accessToken available. Since tokens are\nonly refreshed on-demand it's possible that after an idle time that is longer\nthan the accessTokens lifetime, that on guard activation the token is expired.\n\nFor this reason, the guard does a `manualRefresh` if the token is invalid.\n\nThe autorefreshing is controllable with a configuration option on the refresh\nconfiguration and per route with route data. See `LoginGuardData` for what is\navailable.\n\n```ts\n/**\n * This interface is for your convinience to use with Route data to see what\n * you can configure on the LoginGuard\n */\nexport interface LoginGuardData {\n  /**\n   * Explicitly enable or disable auto refreshing on the route.\n   */\n  isRefreshAllowed: boolean;\n}\n```\n\nIf you need something more custom, I highly recommend implementing your own\nguard as `LoginGuard` itself is also really simple.\n","readmeFilename":"readme.md","description":"Angular JWT authentication library","homepage":"https://github.com/AlexAegis/auth/tree/master/libs/jwt#readme","keywords":["ng","angular","jwt","token","auth","authentication","rxjs","reactive","interceptor","ts","typescript","js","javascript"],"repository":{"type":"git","url":"git+https://github.com/AlexAegis/auth.git"},"author":{"name":"AlexAegis","email":"alexaegis@pm.me","url":"https://www.github.com/AlexAegis"},"bugs":{"url":"https://www.github.com/AlexAegis/auth/issues"},"license":"MIT"}