mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-11-04 00:42:14 +00:00
fix(grok): 修正授权与模型映射边界
This commit is contained in:
1 parent
2c8836e40b
commit
0316994c52
6 files changed
+29
-11
No files matched your search
@@ -8,7 +8,7 @@ vi.mock('@/api/client', () => ({
|
||||
apiClient: { post },
|
||||
}))
|
||||
|
||||
import { createFromSSO, getGrokSSOImportTimeout } from '@/api/admin/grok'
|
||||
import { authorizePassword, createFromSSO, getGrokSSOImportTimeout } from '@/api/admin/grok'
|
||||
|
||||
describe('admin Grok SSO import API', () => {
|
||||
beforeEach(() => {
|
||||
@@ -34,4 +34,20 @@ describe('admin Grok SSO import API', () => {
|
||||
{ timeout: expectedTimeout },
|
||||
)
|
||||
})
|
||||
|
||||
it('preserves password whitespace and applies the authorization timeout', async () => {
|
||||
post.mockResolvedValueOnce({ data: { access_token: 'access-token' } })
|
||||
|
||||
await authorizePassword(' user@example.com ---- password with spaces ', 7)
|
||||
|
||||
expect(post).toHaveBeenCalledWith(
|
||||
'/admin/grok/oauth/password',
|
||||
{
|
||||
email: 'user@example.com',
|
||||
password: ' password with spaces ',
|
||||
proxy_id: 7,
|
||||
},
|
||||
{ timeout: 120_000 },
|
||||
)
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user