mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-12 22:22:32 +01:00
Fixes for Twilio
This commit is contained in:
parent
3ee0186c67
commit
c8fc1a36a3
@ -43,9 +43,19 @@ class TwilioController extends BaseController
|
||||
|
||||
$twilio = new Client($sid, $token);
|
||||
|
||||
$verification = $twilio->verify->v2->services(config('ninja.twilio_verify_sid'))
|
||||
->verifications
|
||||
->create($request->phone, "sms");
|
||||
|
||||
try {
|
||||
$verification = $twilio->verify
|
||||
->v2
|
||||
->services(config('ninja.twilio_verify_sid'))
|
||||
->verifications
|
||||
->create($request->phone, "sms");
|
||||
}
|
||||
catch(\Exception $e) {
|
||||
|
||||
return response()->json(['message' => 'Phone number format is incorrect, please use international number format and try again.'], 400);
|
||||
|
||||
}
|
||||
|
||||
$account->account_sms_verification_code = $verification->sid;
|
||||
$account->account_sms_verification_number = $request->phone;
|
||||
|
@ -32,7 +32,7 @@ class GenerateSmsRequest extends Request
|
||||
{
|
||||
|
||||
return [
|
||||
'phone' => 'required|regex:^\+[1-9]\d{1,14}$',
|
||||
'phone' => 'required|regex:^\+[1-9]\d{1,14}$^',
|
||||
];
|
||||
|
||||
}
|
||||
|
@ -197,4 +197,8 @@ return [
|
||||
'ninja_apple_client_id' => env('APPLE_CLIENT_ID', false),
|
||||
'ninja_apple_client_secret' => env('APPLE_CLIENT_SECRET',false),
|
||||
'ninja_apple_redirect_url' => env('APPLE_REDIRECT_URI',false),
|
||||
'twilio_account_sid' => env('TWILIO_ACCOUNT_SID',false),
|
||||
'twilio_auth_token' => env('TWILIO_AUTH_TOKEN',false),
|
||||
'twilio_verify_sid' => env('TWILIO_VERIFY_SID',false),
|
||||
|
||||
];
|
||||
|
Loading…
Reference in New Issue
Block a user