Feature: add custom id claim (#667)

This feature allows using the custom claim in the JWT token as a user ID.

Refactor claims extractor with options support

Add is_current to the user API response
This commit is contained in:
Givi Khojanashvili
2023-02-04 00:47:20 +04:00
committed by GitHub
parent 494e56d1be
commit 3ec8274b8e
32 changed files with 474 additions and 305 deletions

View File

@@ -46,6 +46,10 @@ components:
type: array
items:
type: string
is_current:
description: Is true if authenticated user is the same as this user
type: boolean
readOnly: true
required:
- id
- email
@@ -1703,4 +1707,4 @@ paths:
'403':
"$ref": "#/components/responses/forbidden"
'500':
"$ref": "#/components/responses/internal_error"
"$ref": "#/components/responses/internal_error"

View File

@@ -566,6 +566,9 @@ type User struct {
// Id User ID
Id string `json:"id"`
// IsCurrent Is true if authenticated user is the same as this user
IsCurrent *bool `json:"is_current,omitempty"`
// Name User's name from idp provider
Name string `json:"name"`