Present nonce in id token

This commit is contained in:
2024-07-28 22:30:51 +08:00
parent 6ef46d984d
commit 7c09138ef7
9 changed files with 51 additions and 32 deletions

View File

@ -107,7 +107,7 @@ const requestedClaims = computed(() => {
const panel = ref("confirm")
async function tryAuthorize() {
const res = await request(`/api/auth/o/authorize${location.search}`, {
const res = await request("/api/auth/o/authorize" + window.location.search, {
headers: { Authorization: `Bearer ${getAtk()}` },
})
@ -139,19 +139,10 @@ function decline() {
async function approve() {
loading.value = true
const res = await request(
"/api/auth/o/authorize?" +
new URLSearchParams({
client_id: route.query["client_id"] as string,
redirect_uri: encodeURIComponent(route.query["redirect_uri"] as string),
response_type: "code",
scope: route.query["scope"] as string,
}),
{
method: "POST",
headers: { Authorization: `Bearer ${getAtk()}` },
},
)
const res = await request("/api/auth/o/authorize" + window.location.search, {
method: "POST",
headers: { Authorization: `Bearer ${getAtk()}` },
})
if (res.status !== 200) {
error.value = await res.text()
@ -169,11 +160,13 @@ function callback(ticket: any) {
}
function getClaimDescription(key: string): ClaimType {
return Object.prototype.hasOwnProperty.call(claims, key) ? claims[key] : {
icon: "mdi-asterisk",
name: key,
description: "Unknown claim...",
}
return Object.prototype.hasOwnProperty.call(claims, key)
? claims[key]
: {
icon: "mdi-asterisk",
name: key,
description: "Unknown claim...",
}
}
</script>