mirror of
https://github.com/immich-app/immich
synced 2026-08-15 13:03:57 +00:00
feat: locked/private view (#18268)
* feat: locked/private view * feat: locked/private view * pr feedback * fix: redirect loop * pr feedback
This commit is contained in:
parent
4935f3e0bb
commit
b7b0b9b6d8
61 changed files with 1018 additions and 186 deletions
6
server/test/fixtures/auth.stub.ts
vendored
6
server/test/fixtures/auth.stub.ts
vendored
|
|
@ -1,4 +1,4 @@
|
|||
import { Session } from 'src/database';
|
||||
import { AuthSession } from 'src/database';
|
||||
import { AuthDto } from 'src/dtos/auth.dto';
|
||||
|
||||
const authUser = {
|
||||
|
|
@ -26,7 +26,7 @@ export const authStub = {
|
|||
user: authUser.user1,
|
||||
session: {
|
||||
id: 'token-id',
|
||||
} as Session,
|
||||
} as AuthSession,
|
||||
}),
|
||||
user2: Object.freeze<AuthDto>({
|
||||
user: {
|
||||
|
|
@ -39,7 +39,7 @@ export const authStub = {
|
|||
},
|
||||
session: {
|
||||
id: 'token-id',
|
||||
} as Session,
|
||||
} as AuthSession,
|
||||
}),
|
||||
adminSharedLink: Object.freeze({
|
||||
user: authUser.admin,
|
||||
|
|
|
|||
1
server/test/fixtures/shared-link.stub.ts
vendored
1
server/test/fixtures/shared-link.stub.ts
vendored
|
|
@ -70,6 +70,7 @@ const assetResponse: AssetResponseDto = {
|
|||
isTrashed: false,
|
||||
libraryId: 'library-id',
|
||||
hasMetadata: true,
|
||||
visibility: AssetVisibility.TIMELINE,
|
||||
};
|
||||
|
||||
const assetResponseWithoutMetadata = {
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ const authFactory = ({
|
|||
}
|
||||
|
||||
if (session) {
|
||||
auth.session = { id: session.id };
|
||||
auth.session = { id: session.id, hasElevatedPermission: false };
|
||||
}
|
||||
|
||||
if (sharedLink) {
|
||||
|
|
@ -127,6 +127,7 @@ const sessionFactory = (session: Partial<Session> = {}) => ({
|
|||
deviceType: 'mobile',
|
||||
token: 'abc123',
|
||||
userId: newUuid(),
|
||||
pinExpiresAt: newDate(),
|
||||
...session,
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue