mirror of
https://github.com/immich-app/immich.git
synced 2025-06-16 21:38:28 +02:00
feat: user pin-code (#18138)
* feat: user pincode * pr feedback * chore: cleanup --------- Co-authored-by: Jason Rasmussen <jason@rasm.me>
This commit is contained in:
parent
55af925ab3
commit
3f719bd8d7
28 changed files with 1392 additions and 39 deletions
open-api/typescript-sdk/src
|
@ -123,6 +123,7 @@ export type UserAdminUpdateDto = {
|
|||
email?: string;
|
||||
name?: string;
|
||||
password?: string;
|
||||
pinCode?: string | null;
|
||||
quotaSizeInBytes?: number | null;
|
||||
shouldChangePassword?: boolean;
|
||||
storageLabel?: string | null;
|
||||
|
@ -510,6 +511,18 @@ export type LogoutResponseDto = {
|
|||
redirectUri: string;
|
||||
successful: boolean;
|
||||
};
|
||||
export type PinCodeChangeDto = {
|
||||
newPinCode: string;
|
||||
password?: string;
|
||||
pinCode?: string;
|
||||
};
|
||||
export type PinCodeSetupDto = {
|
||||
pinCode: string;
|
||||
};
|
||||
export type AuthStatusResponseDto = {
|
||||
password: boolean;
|
||||
pinCode: boolean;
|
||||
};
|
||||
export type ValidateAccessTokenResponseDto = {
|
||||
authStatus: boolean;
|
||||
};
|
||||
|
@ -2017,6 +2030,41 @@ export function logout(opts?: Oazapfts.RequestOpts) {
|
|||
method: "POST"
|
||||
}));
|
||||
}
|
||||
export function resetPinCode({ pinCodeChangeDto }: {
|
||||
pinCodeChangeDto: PinCodeChangeDto;
|
||||
}, opts?: Oazapfts.RequestOpts) {
|
||||
return oazapfts.ok(oazapfts.fetchText("/auth/pin-code", oazapfts.json({
|
||||
...opts,
|
||||
method: "DELETE",
|
||||
body: pinCodeChangeDto
|
||||
})));
|
||||
}
|
||||
export function setupPinCode({ pinCodeSetupDto }: {
|
||||
pinCodeSetupDto: PinCodeSetupDto;
|
||||
}, opts?: Oazapfts.RequestOpts) {
|
||||
return oazapfts.ok(oazapfts.fetchText("/auth/pin-code", oazapfts.json({
|
||||
...opts,
|
||||
method: "POST",
|
||||
body: pinCodeSetupDto
|
||||
})));
|
||||
}
|
||||
export function changePinCode({ pinCodeChangeDto }: {
|
||||
pinCodeChangeDto: PinCodeChangeDto;
|
||||
}, opts?: Oazapfts.RequestOpts) {
|
||||
return oazapfts.ok(oazapfts.fetchText("/auth/pin-code", oazapfts.json({
|
||||
...opts,
|
||||
method: "PUT",
|
||||
body: pinCodeChangeDto
|
||||
})));
|
||||
}
|
||||
export function getAuthStatus(opts?: Oazapfts.RequestOpts) {
|
||||
return oazapfts.ok(oazapfts.fetchJson<{
|
||||
status: 200;
|
||||
data: AuthStatusResponseDto;
|
||||
}>("/auth/status", {
|
||||
...opts
|
||||
}));
|
||||
}
|
||||
export function validateAccessToken(opts?: Oazapfts.RequestOpts) {
|
||||
return oazapfts.ok(oazapfts.fetchJson<{
|
||||
status: 200;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue