...
Update grant code in mithril database,
tokens
table, set:details.used = true
updated_at = now()
Generate ‘access token’ with requested scopes for
user_id
andclient_id
based on value of ACCESS_TOKEN_JWT configuration parameter:true - generate token in JWT format according to /wiki/spaces/PCAB/pages/17426219114 Access tokens JWT format
false - generate token in existing format
Generate ‘refresh token’.
Save tokens that were generated in existing format to mithil database,
tokens
table, set:id = token uuid
name = token name (‘access_token’ or ‘refresh_token')
value = hased token
expires_at = date and time when token will be expired in unix-time format
details = additional details of token (scopes, client_id, grant_type, applicant_user_id, applicant_person_id, app_id)
applicant_user_id = value of
details.applicant_user_id
from grant code (if exists)applicant_person_id = value of
details.applicant_person_id
from grant code (if exists)app_id = uuid of approval between
user_id
,applicant_user_id
andclient_id
user_id = id of user
inserted_at = now()
updated_at = now()
Render a response according to specification.