diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-11 06:08:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-11 06:08:14 +0300 |
commit | b131b6f6804bbcd22a22ce4ffe6566a384843f26 (patch) | |
tree | 12556081b23ccc647a73faf3af2f9f38f84bbb29 /app/assets/javascripts/authentication | |
parent | ca443618b0decc6b2754bf560a9c7a319d3e9873 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/authentication')
-rw-r--r-- | app/assets/javascripts/authentication/webauthn/util.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/assets/javascripts/authentication/webauthn/util.js b/app/assets/javascripts/authentication/webauthn/util.js index eeda2bfaeaf..2a0740cf488 100644 --- a/app/assets/javascripts/authentication/webauthn/util.js +++ b/app/assets/javascripts/authentication/webauthn/util.js @@ -46,6 +46,17 @@ export const bufferToBase64 = (input) => { }; /** + * Return a URL-safe base64 string. + * + * RFC: https://datatracker.ietf.org/doc/html/rfc4648#section-5 + * @param {String} base64Str + * @returns {String} + */ +export const base64ToBase64Url = (base64Str) => { + return base64Str.replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, ''); +}; + +/** * Returns a copy of the given object with the id property converted to buffer * * @param {Object} param |