Editor
1module auth;
2
3fn authenticate(
4 username: String,
5 password: Sensitive<String>
6) -> [IO] Bool {
7 // Check credentials against the database
8 let valid = do check_password(username, password);
9
10 // Log the attempt for auditing
11 do print("Login: user=" + username
12 + " password=" + password);
13
14 valid
15}
Compiler Output
error[E301]: cannot log Sensitive value
--> playground.loon:12:22
|
12 | + " password=" + password);
| ^^^^^^^^
|
= password: Sensitive<String>
= logging Sensitive data is prohibited
= hint: use redact(password) to log a
masked representation
Compilation failed: 1 error
The playground is under development. Loon compiles to WebAssembly, which makes browser execution viable.
Try Loon locally
In the meantime, you can install Loon and try it on your machine.
$ curl -fsSL https://loonlang.org/install.sh | sh
Getting Started Guide