|
7 | 7 | UnauthorizedHttpError, |
8 | 8 | } from "@aklinker1/zeta"; |
9 | 9 | import * as cookie from "cookie"; |
| 10 | +import dedent from "dedent"; |
10 | 11 | import z from "zod"; |
11 | 12 | import type { Setter } from "../../src/types"; |
12 | 13 |
|
@@ -215,25 +216,15 @@ const app = createApp() |
215 | 216 | ); |
216 | 217 |
|
217 | 218 | app.listen(3000, () => { |
218 | | - console.log("Example server started!"); |
219 | | - console.log(""); |
220 | | - console.log("Try out using cookies for auth:"); |
221 | | - console.log( |
222 | | - "1. Visit http://localhost:3000 and get a 401 since you're not logged in.", |
223 | | - ); |
224 | | - console.log( |
225 | | - "2. Log in with tom and you will be redirected to the homepage to see the user details: http://localhost:3000/login?username=tom&password=toms-password", |
226 | | - ); |
227 | | - console.log( |
228 | | - "3. Try to get the list of users, but see you get a 403 because tom is missing the required permission: http://localhost:3000/users", |
229 | | - ); |
230 | | - console.log( |
231 | | - "4. Log out of Tom's account at http://localhost:3000/logout - You will be redirected back to the homepage with a 401", |
232 | | - ); |
233 | | - console.log( |
234 | | - "5. Log in as aaron: http://localhost:3000/login?username=aaron&password=aarons-password", |
235 | | - ); |
236 | | - console.log( |
237 | | - "6. Now you can access the list of users: http://localhost:3000/users", |
238 | | - ); |
| 219 | + console.log(dedent` |
| 220 | + Example server started! |
| 221 | +
|
| 222 | + Try out using cookies for auth: |
| 223 | + 1. Visit http://localhost:3000 and get a 401 since you're not logged in. |
| 224 | + 2. Log in with tom and you will be redirected to the homepage to see the user details: http://localhost:3000/login?username=tom&password=toms-password |
| 225 | + 3. Try to get the list of users, but see you get a 403 because tom is missing the required permission: http://localhost:3000/users |
| 226 | + 4. Log out of Tom's account at http://localhost:3000/logout - You will be redirected back to the homepage with a 401 |
| 227 | + 5. Log in as aaron: http://localhost:3000/login?username=aaron&password=aarons-password |
| 228 | + 6. Now you can access the list of users: http://localhost:3000/users |
| 229 | + `); |
239 | 230 | }); |
0 commit comments