@formio/mcp 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/auth.js +10 -1
  2. package/package.json +1 -1
package/dist/auth.js CHANGED
@@ -37,6 +37,12 @@ function buildLoginPage(loginFormUrl) {
37
37
  <script>
38
38
  var statusEl = document.getElementById('status');
39
39
  Formio.createForm(document.getElementById('formio'), '${loginFormUrl}').then(function(form) {
40
+ // Suppress only Formio's default success alert (to avoid a UI flash); keep login error alerts intact.
41
+ const baseSetAlert = form.setAlert.bind(form);
42
+ form.setAlert = function(type, message, options) {
43
+ if (type === 'success') return;
44
+ return baseSetAlert(type, message, options);
45
+ };
40
46
  form.on('submit', function(submission) {
41
47
  var token = Formio.getToken();
42
48
  statusEl.innerHTML = token ? 'Token captured, completing login...' : 'Error: No token received from Form.io SDK';
@@ -46,7 +52,10 @@ Formio.createForm(document.getElementById('formio'), '${loginFormUrl}').then(fun
46
52
  headers: { 'Content-Type': 'application/json' },
47
53
  body: JSON.stringify({ token: token })
48
54
  }).then(function() {
49
- statusEl.innerHTML = 'Login successful. You can close this tab.';
55
+ document.querySelector('.auth-card').innerHTML =
56
+ '<div class="alert alert-success text-center mb-0" role="alert">' +
57
+ '<i class="bi bi-check-circle-fill me-2"></i>Login successful. You may close this window.' +
58
+ '</div>';
50
59
  }).catch(function(err) {
51
60
  statusEl.innerHTML = 'Error sending token: ' + err.message;
52
61
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/mcp",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Form.io MCP Server",
5
5
  "type": "module",
6
6
  "license": "MIT",