Skip to content
This repository was archived by the owner on Sep 20, 2022. It is now read-only.

Commit 1cd8410

Browse files
author
Hans Kristian Flaatten
committed
Document #createUserAuth() function
1 parent ed44d38 commit 1cd8410

File tree

1 file changed

+43
-1
lines changed

1 file changed

+43
-1
lines changed

README.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,47 @@ client.authenticate(email, password, function(error, user) {
8080
});
8181
```
8282

83-
## [MIT Licensed](https://github.com/Turistforeningen/node-turbasen-auth/blob/master/LICENSE)
83+
### client.createUserAuth()
84+
85+
Create user authentication object for storate in Nasjonal Turbase.
86+
87+
#### Params
88+
89+
* `string` **name** - user name
90+
* `string` **email** - user email
91+
* `string` **password** - user password
92+
* `string` **callback** - callback function (`Error` **error**, `object` **user**)
93+
94+
#### Return
8495

96+
The returned user object contains `navn` (name), `epost` (email), and `pbkdf2`
97+
(user authentication).
98+
99+
```json
100+
{
101+
"navn": "Foo User Name",
102+
"epost": "[email protected]",
103+
"pbkdf2:
104+
"prf": 'HMAC-SHA1',
105+
"itrs": 131072,
106+
"salt": "XO6rZj9WG1UsLEsAGQH16qgZpCM9D7VylFQzwpSmOEo=",
107+
"dkLen": 256,
108+
"hash": "Ir/5WTFgyBJoI3pJ8SaH8qWxdgZ0my6qcOPVPHnYJQ4="
109+
}
110+
}
111+
```
112+
113+
#### Example
114+
115+
```javascript
116+
client.createUserAuth(name, email, password, function(error, user) {
117+
if (error) {
118+
throw error;
119+
}
120+
121+
console.log(user);
122+
}
123+
});
124+
```
125+
126+
## [MIT Licensed](https://github.com/Turistforeningen/node-turbasen-auth/blob/master/LICENSE)

0 commit comments

Comments
 (0)