UNPKG
nautical
Version:
latest (1.0.0)
1.0.0
0.1.2
0.1.1
0.1.0
0.0.3
0.0.2
0.0.1
Wrapper for DigitalOcean's v2 API
github.com/pauldenotter/nautical
pauldenotter/nautical
nautical
/
lib
/
auth.js
13 lines
(11 loc)
•
268 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
module
.
exports
.
authorize
=
function
(
options, config
) {
switch
(config.
authType
||
'oauth'
) {
case
'basic'
: options.
auth
= config.
token
+
':'
;
break
;
case
'oauth'
: options.
headers
.
Authorization
=
'Bearer '
+ config.
token
;
break
; }
return
options; };