Skip to content

Commit afbfaff

Browse files
authored
account-registration: Add examples. (#474)
1 parent 45af3f8 commit afbfaff

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

extensions/account-registration.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,71 @@ Sent by the server if the `REGISTER`/`VERIFY` commands are temporarily
178178
unavailable.
179179

180180

181+
# Examples
182+
183+
## While connected
184+
185+
A client with nick `tester` requests registration of an account named `test`:
186+
187+
C: CAP LS 302
188+
S: CAP * LS :draft/account-registration=before-connect,email-required
189+
C: CAP REQ :draft/account-registration
190+
C: CAP END
191+
...
192+
C: REGISTER test [email protected] hunter2
193+
S: REGISTER VERIFICATION_REQUIRED test :Account created, pending verification; verification code has been sent to [email protected]
194+
195+
The client then inputs the code sent by the server:
196+
197+
C: VERIFY test 39gvcdg4myvnmdcfhvd6exsv4n
198+
S: VERIFY SUCCESS test :Account successfully registered
199+
200+
## `before-connect`
201+
202+
A client connects and asks to register an account named after its current nick:
203+
204+
C: CAP LS 302
205+
C: NICK tester
206+
C: USER tester * * :Tester
207+
S: CAP * LS :draft/account-registration=before-connect,email-required
208+
C: CAP REQ :draft/account-registration
209+
S: CAP * ACK draft/account-registration
210+
C: REGISTER * [email protected] hunter2
211+
S: REGISTER VERIFICATION_REQUIRED tester :Account created, pending verification; verification code has been sent to [email protected]
212+
213+
The client then inputs the code sent by the server, and the server
214+
immediately authenticates it:
215+
216+
C: VERIFY tester 39gvcdg4myvnmdcfhvd6exsv4n
217+
S: VERIFY SUCCESS tester :Account successfully registered
218+
S: 900 * * tester :You are now logged in as tester
219+
220+
The client can then proceed with the connection:
221+
222+
C: CAP END
223+
S: 001 tester :Welcome to the IRC network
224+
...
225+
226+
## With no email or verification
227+
228+
C: CAP LS 302
229+
S: CAP * LS :draft/account-registration=before-connect
230+
C: CAP REQ :draft/account-registration
231+
C: CAP END
232+
...
233+
C: REGISTER * * hunter2
234+
S: REGISTER SUCCESS tester :Account successfully registered
235+
236+
## With `email-required`, but not verified
237+
238+
C: CAP LS 302
239+
S: CAP * LS :draft/account-registration=before-connect,email-required
240+
C: CAP REQ :draft/account-registration
241+
C: CAP END
242+
...
243+
C: REGISTER * [email protected] hunter2
244+
S: REGISTER SUCCESS tester :Account successfully registered
245+
181246
# Client considerations
182247

183248
This section is non-normative.

0 commit comments

Comments
 (0)