(* This file was generated by Ocsigen Start.
   Feel free to use it, modify it, and redistribute it as you wish. *)

[%%shared.start]

(* Edit this file to enable phone connectivity.

   [enable] has to be set to [true].

   Use [Os_connect_phone.set_send_sms_handler] to register your
   SMS-sending function, e.g., by using Amazon SNS or Twilio.

   You can remove this file if you don't need this functionality. *)

let enable = false

let%server () =
  if enable
  then
    Os_connect_phone.set_send_sms_handler (fun ~number message ->
        Printf.printf "Send SMS %s to %s\n%!" message number;
        Lwt.return (Ok ()))

let () =
  if enable
  then (
    Os_user_view.enable_phone ();
    Eliom_registration.Action.register
      ~service:Os_services.confirm_code_recovery_service
      Os_handlers.confirm_code_recovery_handler;
    Eliom_registration.Action.register
      ~service:Os_services.confirm_code_extra_service
      Os_handlers.confirm_code_extra_handler;
    Eliom_registration.Action.register
      ~service:Os_services.confirm_code_signup_service
      Os_handlers.confirm_code_signup_handler)
