This commit is contained in:
2025-08-23 16:48:31 -04:00
parent 3e02ef57b9
commit 632473a7d8
8 changed files with 75 additions and 45 deletions

View File

@ -182,10 +182,9 @@ const TokenTester: React.FC = () => {
console.log('Testing callback with token verification:', values);
// Verify the token received in the callback
// Verify the token received in the callback (type will be auto-detected)
const verifyResponse = await apiService.verifyToken({
app_id: values.app_id,
type: 'user',
token: values.token,
permissions: values.permissions || [],
});

View File

@ -111,7 +111,6 @@ const TokenTesterCallback: React.FC = () => {
const verifyRequest = {
app_id: appId,
type: 'user',
token: token,
permissions: [], // We'll verify without specific permissions
};

View File

@ -184,7 +184,7 @@ const Tokens: React.FC = () => {
const verifyRequest: VerifyRequest = {
app_id: values.app_id,
type: values.token_type || 'static',
// Remove explicit type - it will be auto-detected from token prefix
token: values.token,
permissions: values.permissions || [],
};
@ -505,41 +505,30 @@ const Tokens: React.FC = () => {
width={800}
>
<Space direction="vertical" size="large" style={{ width: '100%' }}>
<Alert
message="Automatic Token Type Detection"
description="The system will automatically detect if your token is a static token (KMST-, KMS2T-, etc.) or user token (KMSUT-, KMS2UT-, etc.) based on its prefix."
type="info"
showIcon
/>
<Form
form={verifyForm}
layout="vertical"
onFinish={handleVerifyToken}
>
<Row gutter={16}>
<Col span={12}>
<Form.Item
name="app_id"
label="Application"
rules={[{ required: true, message: 'Please select an application' }]}
>
<Select placeholder="Select application">
{applications.map(app => (
<Option key={app.app_id} value={app.app_id}>
{app.app_id}
</Option>
))}
</Select>
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
name="token_type"
label="Token Type"
rules={[{ required: true, message: 'Please select token type' }]}
initialValue="static"
>
<Select placeholder="Select token type">
<Option value="static">Static Token</Option>
<Option value="user">User Token (JWT)</Option>
</Select>
</Form.Item>
</Col>
</Row>
<Form.Item
name="app_id"
label="Application"
rules={[{ required: true, message: 'Please select an application' }]}
>
<Select placeholder="Select application">
{applications.map(app => (
<Option key={app.app_id} value={app.app_id}>
{app.app_id}
</Option>
))}
</Select>
</Form.Item>
<Form.Item
name="token"

View File

@ -72,7 +72,6 @@ export interface PaginatedResponse<T> {
export interface VerifyRequest {
app_id: string;
type: string;
user_id?: string;
token: string;
permissions?: string[];