Skip to content

Commit 7c1a7cd

Browse files
committed
fix broken code snippet
1 parent 6d66960 commit 7c1a7cd

File tree

1 file changed

+18
-24
lines changed

1 file changed

+18
-24
lines changed

tutorials/add-authorization/add-authorization.md

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -65,32 +65,25 @@ CAP offers a possibility to add local users for testing as part of the `cds` con
6565
6666
2. In the **package.json** file, add the `cds.requires` section:
6767
68-
```json
69-
{
70-
"name": "incident-management",
71-
"version": "1.0.0",
72-
"description": "A simple CAP project.",
73-
"repository": "<Add your repository here>",
74-
"license": "UNLICENSED",
75-
"private": true,
76-
"dependencies": {
77-
...
78-
},
79-
"scripts": {
80-
...
81-
},
82-
"cds": {
83-
"requires": {
84-
"[development]": {
85-
"auth": {
86-
"kind": "mocked",
87-
"users": {}
88-
}
68+
```json
69+
...
70+
"dependencies": {
71+
...
72+
},
73+
"scripts": {
74+
...
75+
},
76+
"cds": {
77+
"requires": {
78+
"[development]": {
79+
"auth": {
80+
"kind": "mocked",
81+
"users": {}
8982
}
9083
}
91-
},
92-
...
93-
}
84+
}
85+
},
86+
...
9487
```
9588
9689
The code creates the `cds.requires` section that didn't exist so far in the **package.json** file. Also, the code defines which configuration to use when running with the `[development]` profile. You define some general parameters for the authentication behavior. Notice that the users object is empty, in the next step, you will define some test users.
@@ -119,6 +112,7 @@ CAP offers a possibility to add local users for testing as part of the `cds` con
119112
}
120113
}
121114
}
115+
},
122116
```
123117
124118
Each user entry is part of the `users` object. The key is the `id` of the user and they can have different properties. For this scenario, you define a `password` and an array of roles.

0 commit comments

Comments
 (0)