返回 AiToEarn
error.ejs
1 <!DOCTYPE html>
2 <%
3 const pageLocale = typeof locale !== 'undefined' ? locale : 'en-US'
4 const t = typeof messages !== 'undefined' ? messages : {
5 title: 'Authorization',
6 failedTitle: 'Authorization failed',
7 failedDescription: 'Please close this page and try authorizing again.',
8 closeDescription: 'You can close this page now.',
9 errorCode: 'Error code'
10 }
11 const pagePlatformDisplayName = typeof platformDisplayName !== 'undefined' ? platformDisplayName : ''
12 const pagePlatformLogoUrl = typeof platformLogoUrl !== 'undefined' ? platformLogoUrl : ''
13 const pageErrorCode = typeof errorCode !== 'undefined' ? errorCode : ''
14 const pageErrorMessage = typeof errorMessage !== 'undefined' ? errorMessage : t.failedDescription
15 %>
16 <html lang="<%= pageLocale %>">
17
18 <head>
19 <meta charset="UTF-8" />
20 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
21 <title><%= t.failedTitle %></title>
22 <style>
23 * {
24 box-sizing: border-box;
25 }
26
27 :root {
28 --background: #f7f8fb;
29 --foreground: #171717;
30 --muted: #6b7280;
31 --border: #e5e7eb;
32 --danger: #dc2626;
33 --danger-soft: #fee2e2;
34 --muted-bg: #f3f4f6;
35 --card: #fff;
36 }
37
38 body {
39 margin: 0;
40 min-height: 100vh;
41 font-family: Suisseintl, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
42 color: var(--foreground);
43 background:
44 radial-gradient(circle at 1px 1px, rgba(17, 24, 39, 0.08) 1px, transparent 0),
45 var(--background);
46 background-size: 18px 18px;
47 display: flex;
48 align-items: center;
49 justify-content: center;
50 padding: 20px;
51 }
52
53 main {
54 width: min(100%, 520px);
55 background: var(--card);
56 border: 1px solid var(--border);
57 border-radius: 12px;
58 box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
59 overflow: hidden;
60 }
61
62 header {
63 padding: 24px;
64 border-bottom: 1px solid var(--border);
65 }
66
67 .platform {
68 display: flex;
69 align-items: center;
70 gap: 12px;
71 margin-bottom: 16px;
72 min-width: 0;
73 }
74
75 .platform-logo {
76 width: 38px;
77 height: 38px;
78 border-radius: 10px;
79 border: 1px solid var(--border);
80 object-fit: contain;
81 background: #fff;
82 flex: 0 0 auto;
83 }
84
85 .status {
86 display: inline-flex;
87 align-items: center;
88 gap: 8px;
89 min-height: 28px;
90 padding: 4px 10px;
91 border-radius: 999px;
92 color: #991b1b;
93 background: var(--danger-soft);
94 font-size: 13px;
95 font-weight: 700;
96 }
97
98 .dot {
99 width: 8px;
100 height: 8px;
101 border-radius: 50%;
102 background: var(--danger);
103 }
104
105 h1 {
106 margin: 0 0 10px;
107 font-size: 24px;
108 line-height: 1.25;
109 }
110
111 p {
112 margin: 0;
113 color: var(--muted);
114 font-size: 14px;
115 line-height: 1.6;
116 }
117
118 .content {
119 padding: 20px 24px 24px;
120 }
121
122 .error-message {
123 margin: 0 0 14px;
124 padding: 12px;
125 border-radius: 10px;
126 background: var(--muted-bg);
127 color: #374151;
128 font-size: 14px;
129 line-height: 1.5;
130 word-break: break-word;
131 }
132
133 .error-code {
134 color: var(--muted);
135 font-size: 13px;
136 word-break: break-all;
137 }
138
139 @media (max-width: 520px) {
140 body {
141 align-items: stretch;
142 padding: 12px;
143 }
144
145 header,
146 .content {
147 padding-left: 18px;
148 padding-right: 18px;
149 }
150 }
151 </style>
152 </head>
153
154 <body>
155 <main>
156 <header>
157 <div class="platform">
158 <% if (pagePlatformLogoUrl) { %>
159 <img class="platform-logo" src="<%= pagePlatformLogoUrl %>" alt="" />
160 <% } %>
161 <span class="status"><span class="dot"></span><%= pagePlatformDisplayName || t.title %></span>
162 </div>
163 <h1><%= t.failedTitle %></h1>
164 <p><%= t.failedDescription %></p>
165 </header>
166
167 <div class="content">
168 <p class="error-message"><%= pageErrorMessage %></p>
169 <% if (pageErrorCode !== '') { %>
170 <p class="error-code"><%= t.errorCode %>: <%= pageErrorCode %></p>
171 <% } %>
172 </div>
173 </main>
174 </body>
175
176 </html>
177
177 lines Plain Text