diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index ca5c1908fe..92a336ddfe 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -2772,6 +2772,7 @@ $LANG = array( 'slack_incoming_webhooks' => 'Slack incoming webhooks', 'accept' => 'Accept', 'accepted_terms' => 'Successfully accepted the latest terms of service', + 'invalid_url' => 'Invalid URL', ); diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index 0f229e85da..16154922aa 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -146,13 +146,14 @@ showCancelButton: true, confirmButtonText: 'Save', }).then(function (value) { - if (!value) { + if (! value || value.indexOf('http') !== 0) { + swal("{{ trans('texts.invalid_url') }}") return; } value = value.replace(/\/+$/, '') + '/time_tracker'; localStorage.setItem('last:time_tracker:url', value); location.reload(); - }) + }).catch(swal.noop); } @endif