mirror of
https://github.com/immich-app/immich.git
synced 2025-06-06 21:38:26 +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
|
@ -2294,6 +2294,139 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"/auth/pin-code": {
|
||||
"delete": {
|
||||
"operationId": "resetPinCode",
|
||||
"parameters": [],
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/PinCodeChangeDto"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": ""
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"bearer": []
|
||||
},
|
||||
{
|
||||
"cookie": []
|
||||
},
|
||||
{
|
||||
"api_key": []
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"Authentication"
|
||||
]
|
||||
},
|
||||
"post": {
|
||||
"operationId": "setupPinCode",
|
||||
"parameters": [],
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/PinCodeSetupDto"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": ""
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"bearer": []
|
||||
},
|
||||
{
|
||||
"cookie": []
|
||||
},
|
||||
{
|
||||
"api_key": []
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"Authentication"
|
||||
]
|
||||
},
|
||||
"put": {
|
||||
"operationId": "changePinCode",
|
||||
"parameters": [],
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/PinCodeChangeDto"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": ""
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"bearer": []
|
||||
},
|
||||
{
|
||||
"cookie": []
|
||||
},
|
||||
{
|
||||
"api_key": []
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"Authentication"
|
||||
]
|
||||
}
|
||||
},
|
||||
"/auth/status": {
|
||||
"get": {
|
||||
"operationId": "getAuthStatus",
|
||||
"parameters": [],
|
||||
"responses": {
|
||||
"200": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/AuthStatusResponseDto"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": ""
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"bearer": []
|
||||
},
|
||||
{
|
||||
"cookie": []
|
||||
},
|
||||
{
|
||||
"api_key": []
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"Authentication"
|
||||
]
|
||||
}
|
||||
},
|
||||
"/auth/validateToken": {
|
||||
"post": {
|
||||
"operationId": "validateAccessToken",
|
||||
|
@ -9031,6 +9164,21 @@
|
|||
],
|
||||
"type": "string"
|
||||
},
|
||||
"AuthStatusResponseDto": {
|
||||
"properties": {
|
||||
"password": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"pinCode": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"password",
|
||||
"pinCode"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"AvatarUpdate": {
|
||||
"properties": {
|
||||
"color": {
|
||||
|
@ -10964,6 +11112,37 @@
|
|||
],
|
||||
"type": "object"
|
||||
},
|
||||
"PinCodeChangeDto": {
|
||||
"properties": {
|
||||
"newPinCode": {
|
||||
"example": "123456",
|
||||
"type": "string"
|
||||
},
|
||||
"password": {
|
||||
"type": "string"
|
||||
},
|
||||
"pinCode": {
|
||||
"example": "123456",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"newPinCode"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"PinCodeSetupDto": {
|
||||
"properties": {
|
||||
"pinCode": {
|
||||
"example": "123456",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"pinCode"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"PlacesResponseDto": {
|
||||
"properties": {
|
||||
"admin1name": {
|
||||
|
@ -13958,6 +14137,11 @@
|
|||
"password": {
|
||||
"type": "string"
|
||||
},
|
||||
"pinCode": {
|
||||
"example": "123456",
|
||||
"nullable": true,
|
||||
"type": "string"
|
||||
},
|
||||
"quotaSizeInBytes": {
|
||||
"format": "int64",
|
||||
"minimum": 0,
|
||||
|
|
|
@ -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