Skip to content

Commit 1c1c081

Browse files
committed
fixed unclosed block comment
1 parent be015e1 commit 1c1c081

File tree

1 file changed

+6
-2
lines changed
  • module4-authentication-and-security/r1.1.1-authentication-persistence

1 file changed

+6
-2
lines changed

module4-authentication-and-security/r1.1.1-authentication-persistence/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,20 @@ eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4
7777
This is a string that has 3 parts separated by a dot (.) and `base64` encoded. It can be decoded easily using any `base64` decoder.
7878

7979
```js
80-
const token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTYzMjk0MTc4NCwiZXhwIjoxNjMyOTQ1Mzg0fQ.MVnMhRVLYhaGqtZEX4AiEMrQwFWRvRLp6MATodg6E6A';
80+
const token =
81+
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTYzMjk0MTc4NCwiZXhwIjoxNjMyOTQ1Mzg0fQ.MVnMhRVLYhaGqtZEX4AiEMrQwFWRvRLp6MATodg6E6A";
8182

82-
token.split('.').forEach(part => console.log(atob(part)))
83+
token.split(".").forEach((part) => console.log(atob(part)));
8384

8485
/* Output:
86+
8587
{"typ":"JWT","alg":"HS256"}
8688
8789
{"sub":"1234567890","name":"John Doe","admin":true,"iat":1632941784,"exp":1632945384}
8890
8991
1YÌ�Kb†ªÖD_€"ÊÐÀU‘½éèÀ¡Ø:
92+
93+
*/
9094
```
9195

9296
The first part defines the _algorithm_ and the type. The second part is called the payload or _claims_, which identifies the user, issue time, expiry time, and other data. The third part is called the _signature_.

0 commit comments

Comments
 (0)