diff options
author | enahum <nahumhbl@gmail.com> | 2016-07-20 17:01:10 -0400 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2016-07-20 13:01:10 -0800 |
commit | 86d496c9b72c97b905bfc23d26556032c6fa1d05 (patch) | |
tree | 5750d849c44f62d3269169e80fbb69e86e92867d /webapp | |
parent | b0090214ef4e550b1e82c6f8cb5f717bfefe358b (diff) | |
download | chat-86d496c9b72c97b905bfc23d26556032c6fa1d05.tar.gz chat-86d496c9b72c97b905bfc23d26556032c6fa1d05.tar.bz2 chat-86d496c9b72c97b905bfc23d26556032c6fa1d05.zip |
PLT-3629 fix uploading certificates if the files in the config do not exists (#3634)
Diffstat (limited to 'webapp')
-rw-r--r-- | webapp/client/client.jsx | 13 | ||||
-rw-r--r-- | webapp/components/admin_console/saml_settings.jsx | 20 |
2 files changed, 33 insertions, 0 deletions
diff --git a/webapp/client/client.jsx b/webapp/client/client.jsx index 5ee28be78..88da51372 100644 --- a/webapp/client/client.jsx +++ b/webapp/client/client.jsx @@ -1667,4 +1667,17 @@ export default class Client { send({filename}). end(this.handleResponse.bind(this, 'removeCertificateFile', success, error)); } + + samlCertificateStatus(success, error) { + request.get(`${this.getAdminRoute()}/saml_cert_status`). + set(this.defaultHeaders). + type('application/json'). + accept('application/json'). + end((err, res) => { + if (err) { + return error(err); + } + return success(res.body); + }); + } } diff --git a/webapp/components/admin_console/saml_settings.jsx b/webapp/components/admin_console/saml_settings.jsx index ae6f3e169..9fb78f472 100644 --- a/webapp/components/admin_console/saml_settings.jsx +++ b/webapp/components/admin_console/saml_settings.jsx @@ -70,6 +70,26 @@ export default class SamlSettings extends AdminSettings { }; } + componentWillMount() { + Client.samlCertificateStatus( + (data) => { + const files = {}; + if (!data.IdpCertificateFile) { + files.idpCertificateFile = ''; + } + + if (!data.PublicCertificateFile) { + files.publicCertificateFile = ''; + } + + if (!data.PrivateKeyFile) { + files.privateKeyFile = ''; + } + this.setState(files); + } + ); + } + uploadCertificate(id, file, callback) { Client.uploadCertificateFile( file, |