mirror of
				https://github.com/immich-app/immich.git
				synced 2025-11-04 03:39:37 -05:00 
			
		
		
		
	* feat(server,web,mobile): Add optional password option for share links. Signed-off-by: jarvis2f <137974272+jarvis2f@users.noreply.github.com> * feat(server,web): Update shared-link.controller and page.svelte for improved cookie handling and metadata updates. Signed-off-by: jarvis2f <137974272+jarvis2f@users.noreply.github.com> --------- Signed-off-by: jarvis2f <137974272+jarvis2f@users.noreply.github.com>
		
			
				
	
	
		
			58 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			58 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
export const errorStub = {
 | 
						|
  unauthorized: {
 | 
						|
    error: 'Unauthorized',
 | 
						|
    statusCode: 401,
 | 
						|
    message: 'Authentication required',
 | 
						|
  },
 | 
						|
  forbidden: {
 | 
						|
    error: 'Forbidden',
 | 
						|
    statusCode: 403,
 | 
						|
    message: expect.any(String),
 | 
						|
  },
 | 
						|
  wrongPassword: {
 | 
						|
    error: 'Bad Request',
 | 
						|
    statusCode: 400,
 | 
						|
    message: 'Wrong password',
 | 
						|
  },
 | 
						|
  invalidToken: {
 | 
						|
    error: 'Unauthorized',
 | 
						|
    statusCode: 401,
 | 
						|
    message: 'Invalid user token',
 | 
						|
  },
 | 
						|
  invalidShareKey: {
 | 
						|
    error: 'Unauthorized',
 | 
						|
    statusCode: 401,
 | 
						|
    message: 'Invalid share key',
 | 
						|
  },
 | 
						|
  invalidSharePassword: {
 | 
						|
    error: 'Unauthorized',
 | 
						|
    statusCode: 401,
 | 
						|
    message: 'Invalid password',
 | 
						|
  },
 | 
						|
  badRequest: (message: any = null) => ({
 | 
						|
    error: 'Bad Request',
 | 
						|
    statusCode: 400,
 | 
						|
    message: message ?? expect.anything(),
 | 
						|
  }),
 | 
						|
  noPermission: {
 | 
						|
    error: 'Bad Request',
 | 
						|
    statusCode: 400,
 | 
						|
    message: expect.stringContaining('Not found or no'),
 | 
						|
  },
 | 
						|
  incorrectLogin: {
 | 
						|
    error: 'Unauthorized',
 | 
						|
    statusCode: 401,
 | 
						|
    message: 'Incorrect email or password',
 | 
						|
  },
 | 
						|
  alreadyHasAdmin: {
 | 
						|
    error: 'Bad Request',
 | 
						|
    statusCode: 400,
 | 
						|
    message: 'The server already has an admin',
 | 
						|
  },
 | 
						|
  noDeleteUploadLibrary: {
 | 
						|
    error: 'Bad Request',
 | 
						|
    statusCode: 400,
 | 
						|
    message: 'Cannot delete the last upload library',
 | 
						|
  },
 | 
						|
};
 |