6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'app/controllers/standard_id/provider/revocation_controller.rb', line 6
def create
token = params[:token]
return head :ok if token.blank?
payload = StandardId::JwtService.decode(token)
return head :ok if payload.nil?
jti = payload[:jti]
return head :ok if jti.blank?
expires_at = payload[:exp] ? Time.at(payload[:exp]) : 1.day.from_now
RevokedToken.revoke!(
jti: jti,
client_id: @client_credential.client_id,
token_type: params[:token_type_hint],
expires_at: expires_at
)
head :ok
end
|