-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsocket.yml
More file actions
130 lines (120 loc) · 2.82 KB
/
socket.yml
File metadata and controls
130 lines (120 loc) · 2.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: magiclink
description: Description of magiclink
config:
MAILGUN_API_KEY:
required: true
MAILGUN_DOMAIN_NAME:
required: true
FROM:
required: true
classes:
user_profile:
- name: email
type: string
- name: firstname
type: string
- name: lastname
type: string
- name: isVolunteer
type: boolean
magiclink:
- name: email
type: string
filter_index: true
- name: token
type: string
- name: status
type: string
- name: link
type: text
- name: valid_until
type: string
endpoints:
verify:
description: "Endpoint used to verify user login"
file: scripts/verify.js
parameters:
email:
type: string
description: "user email"
example: "johndoe@foe.com"
response:
mimetype: application/json
examples:
-
exit_code: 202
description: Success
example: |
userData {
userKey,
id,
firstname,
lastname,
isVolunteer,
email
}
-
exit_code: 403
description: Failed
example: "Unauthorized"
login:
description: Endpoint used to login/create user account
file: scripts/login.js
parameters:
email:
type: string
description: "Email to login user"
example: "jon.doe@doe.com"
response:
mimetype: text/plain
examples:
-
exit_code: 200
description: Success
example: "Waiting for magiclink"
-
exit_code: 400
description: Failed
example: No email or status provided
confirm:
description: "Endpoint used to confirm user link click"
file: scripts/confirm.js
parameters:
token:
type: string
description: "user uid"
example: "4fdasf#$#()adsczx"
status:
type: string
description: "status of user login"
example: "allow/disallow"
response:
mimetype: application/json
examples:
-
exit_code: 200
description: Success
example: "https://magiclink.com/?email=joe.doe@doe.com&uid=dsakjd!@dkjJKSsda$$#12&status=allow"
-
exit_code: 400
description: Failed
example: Something went wrong
getuser:
description: "Endpoint used to confirm user link click"
file: scripts/getuser.js
parameters:
userkey:
type: string
description: "user key"
example: "4fdasf#$#()adsczx"
response:
mimetype: application/json
examples:
-
exit_code: 200
description: Success
example: "user data"
-
exit_code: 400
description: Failed
example: Wrong user key