mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-28 17:25:04 +03:00
feat: device authorization endpoint (#270)
Co-authored-by: Elias Schneider <login@eliasschneider.com>
This commit is contained in:
22
frontend/tests/utils/oidc.util.ts
Normal file
22
frontend/tests/utils/oidc.util.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import type { Page } from '@playwright/test';
|
||||
|
||||
async function getUserCode(page: Page, clientId: string, clientSecret: string) {
|
||||
const response = await page.request
|
||||
.post('/api/oidc/device/authorize', {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
form: {
|
||||
client_id: clientId,
|
||||
client_secret: clientSecret,
|
||||
scope: 'openid profile email'
|
||||
}
|
||||
})
|
||||
.then((r) => r.json());
|
||||
|
||||
return response.user_code;
|
||||
}
|
||||
|
||||
export default {
|
||||
getUserCode
|
||||
};
|
||||
Reference in New Issue
Block a user