1919 *)
2020
2121open % server Lwt. Syntax
22+
2223type % shared sms_error_core = [`Unknown | `Send | `Limit | `Invalid_number ]
2324type % shared sms_error = [`Ownership | sms_error_core]
2425
@@ -100,8 +101,8 @@ let%server confirm_code myid code =
100101let % rpc confirm_code_extra myid (code : string ) : bool Lwt. t =
101102 confirm_code myid code
102103
103- let % server confirm_code_signup_no_connect ~first_name ~last_name ~code ~password
104- ()
104+ let % server
105+ confirm_code_signup_no_connect ~first_name ~last_name ~code ~password ()
105106 =
106107 Lwt. bind (Eliom_reference. get activation_code_ref) (function
107108 | Some (number , code' , _ ) when code = code' ->
@@ -114,8 +115,13 @@ let%server confirm_code_signup_no_connect ~first_name ~last_name ~code ~password
114115 Lwt. return_some userid
115116 | _ -> Lwt. return_none)
116117
117- let % rpc confirm_code_signup ~(first_name : string ) ~(last_name : string )
118- ~(code : string ) ~(password : string ) () : bool Lwt. t
118+ let % rpc
119+ confirm_code_signup
120+ ~(first_name : string )
121+ ~(last_name : string )
122+ ~(code : string )
123+ ~(password : string )
124+ () : bool Lwt. t
119125 =
120126 Lwt. bind
121127 (confirm_code_signup_no_connect ~first_name ~last_name ~code ~password () )
@@ -136,16 +142,16 @@ let%rpc confirm_code_recovery (code : string) : bool Lwt.t =
136142 | _ -> Lwt. return_false)
137143
138144let % rpc connect ~(keepmeloggedin : bool ) ~(password : string ) (number : string )
139- : [`Login_ok | `Wrong_password | `No_such_user | `Password_not_set ] Lwt. t
145+ : [`Login_ok | `Wrong_password | `No_such_user | `Password_not_set ] Lwt. t
140146 =
141147 Lwt. catch
142148 (fun () ->
143149 let * userid = Os_db.User. verify_password_phone ~password ~number in
144150 let * () = Os_session. connect ~expire: (not keepmeloggedin) userid in
145151 Lwt. return `Login_ok )
146152 (function
147- | Os_db. Empty_password | Os_db. Wrong_password ->
148- Lwt. return `Wrong_password
149- | Os_db. No_such_user -> Lwt. return `No_such_user
150- | Os_db. Password_not_set -> Lwt. return `Password_not_set
151- | exc -> Lwt. reraise exc)
153+ | Os_db. Empty_password | Os_db. Wrong_password ->
154+ Lwt. return `Wrong_password
155+ | Os_db. No_such_user -> Lwt. return `No_such_user
156+ | Os_db. Password_not_set -> Lwt. return `Password_not_set
157+ | exc -> Lwt. reraise exc)
0 commit comments