mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-12-11 17:50:39 +01:00
1 line
25 KiB
Plaintext
1 line
25 KiB
Plaintext
|
{"version":3,"file":"webauthnService-CpjBMhYF.js","sources":["../../../resources/js/services/webauthn/webauthnAbortService.js","../../../resources/js/services/webauthn/isValidDomain.js","../../../resources/js/services/webauthn/identifyRegistrationError.js","../../../resources/js/services/webauthn/identifyAuthenticationError.js","../../../resources/js/services/webauthn/webauthnService.js"],"sourcesContent":["/**\n * MIT License\n *\n * Copyright (c) 2020 Matthew Miller - https://github.com/MasterKale/SimpleWebAuthn\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n * A way to cancel an existing WebAuthn request, for example to cancel a\n * WebAuthn autofill authentication request for a manual authentication attempt.\n */\nclass WebauthnAbortService {\n controller;\n \n /**\n * Prepare an abort signal that will help support multiple auth attempts without needing to\n * reload the page\n */\n createNewAbortSignal() {\n // Abort any existing calls to navigator.credentials.create() or navigator.credentials.get()\n if (this.controller) {\n const abortError = new Error(\n 'Cancelling existing WebAuthn API call for new one',\n );\n abortError.name = 'AbortError';\n this.controller.abort(abortError);\n }\n\n const newController = new AbortController();\n\n this.controller = newController;\n return newController.signal;\n }\n}\n\nexport const webauthnAbortService = new WebauthnAbortService();","/**\n * A simple test to determine if a hostname is a properly-formatted domain name\n *\n * A \"valid domain\" is defined here: https://url.spec.whatwg.org/#valid-domain\n *\n * Regex sourced from here:\n * https://www.oreilly.com/library/view/regular-expressions-cookbook/9781449327453/ch08s15.html\n */\nexport function isValidDomain(hostname) {\n return (\n // Consider localhost valid as well since it's okay wrt Secure Contexts\n hostname === 'localhost' ||\n /^([a-z0-9]+(-[a-z0-9]+)*\\.)+[a-z]{2,}$/i.test(hostname)\n );\n}","/**\n * MIT License\n *\n * Copyright (c) 2023 Bubka - https://github.com/Bubka/2FAuth\n * Copyright (c) 2020 Matthew Miller - https://github.com/MasterKale/SimpleWebAuthn\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS
|