mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-03-01 16:20:25 +00:00
Add Passkey (WebAuthn) authentication support
Introduces Passkey (WebAuthn) registration and authentication to both backend and frontend. Backend adds new API endpoints, middleware exceptions, and a PasskeyHelper for credential management using @simplewebauthn/server. Frontend integrates @simplewebauthn/browser, updates login and config pages for Passkey registration and login flows, and adds related UI and controller methods.
This commit is contained in:
@@ -212,4 +212,35 @@ export default class WebUIManager {
|
||||
);
|
||||
return data.data;
|
||||
}
|
||||
|
||||
// Passkey相关方法
|
||||
public static async generatePasskeyRegistrationOptions () {
|
||||
const { data } = await serverRequest.post<ServerResponse<any>>(
|
||||
'/auth/passkey/generate-registration-options'
|
||||
);
|
||||
return data.data;
|
||||
}
|
||||
|
||||
public static async verifyPasskeyRegistration (response: any) {
|
||||
const { data } = await serverRequest.post<ServerResponse<any>>(
|
||||
'/auth/passkey/verify-registration',
|
||||
{ response }
|
||||
);
|
||||
return data.data;
|
||||
}
|
||||
|
||||
public static async generatePasskeyAuthenticationOptions () {
|
||||
const { data } = await serverRequest.post<ServerResponse<any>>(
|
||||
'/auth/passkey/generate-authentication-options'
|
||||
);
|
||||
return data.data;
|
||||
}
|
||||
|
||||
public static async verifyPasskeyAuthentication (response: any) {
|
||||
const { data } = await serverRequest.post<ServerResponse<any>>(
|
||||
'/auth/passkey/verify-authentication',
|
||||
{ response }
|
||||
);
|
||||
return data.data;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user