web/admin/providers/oauth2: add generated defaults for clientId and secret

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-04-03 14:47:34 +02:00
parent 66d7d598fb
commit aaa1f92945
7 changed files with 22 additions and 10 deletions

View File

@ -1,4 +1,5 @@
import * as base64js from "base64-js";
import { hexEncode } from "../../../utils";
export function b64enc(buf: Uint8Array): string {
return base64js.fromByteArray(buf)
@ -13,14 +14,6 @@ export function b64RawEnc(buf: Uint8Array): string {
.replace(/\//g, "_");
}
export function hexEncode(buf: Uint8Array): string {
return Array.from(buf)
.map(function (x) {
return ("0" + x.toString(16)).substr(-2);
})
.join("");
}
/**
* Transforms items in the credentialCreateOptions generated on the server
* into byte arrays expected by the navigator.credentials.create() call