]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - shared/models/server/server-error-code.enum.ts
Implement signup approval in server
[github/Chocobozzz/PeerTube.git] / shared / models / server / server-error-code.enum.ts
CommitLineData
e6abf95e 1export const enum ServerErrorCode {
c756bae0
RK
2 /**
3 * The simplest form of payload too large: when the file size is over the
4 * global file size limit
5 */
6 MAX_FILE_SIZE_REACHED = 'max_file_size_reached',
7
8 /**
9 * The payload is too large for the user quota set
10 */
11 QUOTA_REACHED = 'quota_reached',
12
81628e50
RK
13 /**
14 * Error yielded upon trying to access a video that is not federated, nor can
15 * be. This may be due to: remote videos on instances that are not followed by
16 * yours, and with your instance disallowing unknown instances being accessed.
17 */
18 DOES_NOT_RESPECT_FOLLOW_CONSTRAINTS = 'does_not_respect_follow_constraints',
19
c756bae0
RK
20 LIVE_NOT_ENABLED = 'live_not_enabled',
21 LIVE_NOT_ALLOWING_REPLAY = 'live_not_allowing_replay',
22 LIVE_CONFLICTING_PERMANENT_AND_SAVE_REPLAY = 'live_conflicting_permanent_and_save_replay',
81628e50
RK
23 /**
24 * Pretty self-explanatory: the set maximum number of simultaneous lives was
25 * reached, and this error is typically there to inform the user trying to
26 * broadcast one.
27 */
28 MAX_INSTANCE_LIVES_LIMIT_REACHED = 'max_instance_lives_limit_reached',
81628e50
RK
29 /**
30 * Pretty self-explanatory: the set maximum number of simultaneous lives FOR
31 * THIS USER was reached, and this error is typically there to inform the user
32 * trying to broadcast one.
33 */
34 MAX_USER_LIVES_LIMIT_REACHED = 'max_user_lives_limit_reached',
35
36 /**
37 * A torrent should have at most one correct video file. Any more and we will
38 * not be able to choose automatically.
39 */
5a9a56b7
C
40 INCORRECT_FILES_IN_TORRENT = 'incorrect_files_in_torrent',
41
e364e31e
C
42 COMMENT_NOT_ASSOCIATED_TO_VIDEO = 'comment_not_associated_to_video',
43
44 MISSING_TWO_FACTOR = 'missing_two_factor',
45 INVALID_TWO_FACTOR = 'invalid_two_factor',
46
47 ACCOUNT_WAITING_FOR_APPROVAL = 'account_waiting_for_approval',
48 ACCOUNT_APPROVAL_REJECTED = 'account_approval_rejected'
81628e50
RK
49}
50
51/**
52 * oauthjs/oauth2-server error codes
53 * @see https://datatracker.ietf.org/doc/html/rfc6749#section-5.2
54 **/
55export const enum OAuth2ErrorCode {
56 /**
57 * The provided authorization grant (e.g., authorization code, resource owner
58 * credentials) or refresh token is invalid, expired, revoked, does not match
59 * the redirection URI used in the authorization request, or was issued to
60 * another client.
61 *
62 * @see https://github.com/oauthjs/node-oauth2-server/blob/master/lib/errors/invalid-grant-error.js
63 */
64 INVALID_GRANT = 'invalid_grant',
65
66 /**
67 * Client authentication failed (e.g., unknown client, no client authentication
68 * included, or unsupported authentication method).
69 *
70 * @see https://github.com/oauthjs/node-oauth2-server/blob/master/lib/errors/invalid-client-error.js
71 */
e030bfb5
C
72 INVALID_CLIENT = 'invalid_client',
73
e030bfb5
C
74 /**
75 * The access token provided is expired, revoked, malformed, or invalid for other reasons
76 *
77 * @see https://github.com/oauthjs/node-oauth2-server/blob/master/lib/errors/invalid-token-error.js
78 */
e364e31e 79 INVALID_TOKEN = 'invalid_token'
e6abf95e 80}