jwtbutler 1.7.8 → 1.8.3

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.
package/README.md CHANGED
@@ -67,11 +67,11 @@ sso: [
67
67
  ];
68
68
  ```
69
69
 
70
- then deploy the helper file [sso.html](https://github.com/vielhuber/jwtbutler/blob/master/_dist/sso.html) in the root public directories of all pages that use single sign on. don't forget to fill out all origin page domains in line 7. Also make sure to add a valid Content-Security-Policy (for example with the help of a [.htaccess](https://github.com/vielhuber/jwtbutler/blob/master/_dist/.htaccess) file).
70
+ then deploy the helper file [sso.html](https://github.com/vielhuber/jwtbutler/blob/main/_dist/sso.html) in the root public directories of all pages that use single sign on. don't forget to fill out all origin page domains in line 7. Also make sure to add a valid Content-Security-Policy (for example with the help of a [.htaccess](https://github.com/vielhuber/jwtbutler/blob/main/_dist/.htaccess) file).
71
71
 
72
72
  ### custom login dom
73
73
 
74
- if you need a custom login html dom instead of the default one, you also can pass it to the object:
74
+ if you need a custom login html dom instead of the default one, simply pass it as an arg:
75
75
 
76
76
  ```js
77
77
  login_form: `
@@ -81,11 +81,11 @@ login_form: `
81
81
  <ul class="login-form__items">
82
82
  <li class="login-form__item">
83
83
  <label class="login-form__label login-form__label--email" for="login-form__label--email">E-Mail-Adresse</label>
84
- <input class="login-form__input login-form__input--email" id="login-form__label--email" type="text" required="required" name="email" />
84
+ <input class="login-form__input login-form__input--email" id="login-form__label--email" type="text" required="required" autocomplete="email" name="email" />
85
85
  </li>
86
86
  <li class="login-form__item">
87
87
  <label class="login-form__label login-form__label--password" for="login-form__label--password">Passwort</label>
88
- <input class="login-form__input login-form__input--password" id="login-form__label--password" type="password" required="required" name="password" />
88
+ <input class="login-form__input login-form__input--password" id="login-form__label--password" type="password" required="required" autocomplete="current-password" name="password" />
89
89
  </li>
90
90
  <li class="login-form__item">
91
91
  <input class="login-form__submit" type="submit" value="Anmelden" />
@@ -4,8 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- require("core-js/modules/es.regexp.constructor.js");
8
- require("core-js/modules/es.regexp.exec.js");
9
7
  class helpers {
10
8
  static cookieExists(cookie_name) {
11
9
  if (document.cookie !== undefined && this.cookieGet(cookie_name) !== null) {
@@ -275,7 +275,25 @@ class jwtbutler {
275
275
  }
276
276
  buildUpLoginFormHtml() {
277
277
  if (!('login_form' in this.config) || this.config.login_form == '') {
278
- this.config.login_form = "<div class=\"login-form\">\n <div class=\"login-form__inner\">\n <form class=\"login-form__form\">\n <ul class=\"login-form__items\">\n <li class=\"login-form__item\">\n <label class=\"login-form__label login-form__label--".concat(this.config.auth_login, "\" for=\"login-form__label--").concat(this.config.auth_login, "\">").concat(this.config.auth_login === 'email' ? 'E-Mail-Adresse' : this.config.auth_login === 'username' ? 'Benutzername' : this.config.auth_login, "</label>\n <input class=\"login-form__input login-form__input--").concat(this.config.auth_login, "\" id=\"login-form__label--").concat(this.config.auth_login, "\" type=\"text\" required=\"required\" name=\"").concat(this.config.auth_login, "\" />\n </li>\n <li class=\"login-form__item\">\n <label class=\"login-form__label login-form__label--password\" for=\"login-form__label--password\">Passwort</label>\n <input class=\"login-form__input login-form__input--password\" id=\"login-form__label--password\" type=\"password\" required=\"required\" name=\"password\" />\n </li>\n <li class=\"login-form__item\">\n <input class=\"login-form__submit\" type=\"submit\" value=\"Anmelden\" />\n </li>\n </ul>\n </form>\n </div>\n </div>");
278
+ this.config.login_form = `<div class="login-form">
279
+ <div class="login-form__inner">
280
+ <form class="login-form__form">
281
+ <ul class="login-form__items">
282
+ <li class="login-form__item">
283
+ <label class="login-form__label login-form__label--${this.config.auth_login}" for="login-form__label--${this.config.auth_login}">${this.config.auth_login === 'email' ? 'E-Mail-Adresse' : this.config.auth_login === 'username' ? 'Benutzername' : this.config.auth_login}</label>
284
+ <input class="login-form__input login-form__input--${this.config.auth_login}" id="login-form__label--${this.config.auth_login}" type="text" required="required" autocomplete="${this.config.auth_login}" name="${this.config.auth_login}" />
285
+ </li>
286
+ <li class="login-form__item">
287
+ <label class="login-form__label login-form__label--password" for="login-form__label--password">Passwort</label>
288
+ <input class="login-form__input login-form__input--password" id="login-form__label--password" type="password" required="required" autocomplete="current-password" name="password" />
289
+ </li>
290
+ <li class="login-form__item">
291
+ <input class="login-form__submit" type="submit" value="Anmelden" />
292
+ </li>
293
+ </ul>
294
+ </form>
295
+ </div>
296
+ </div>`;
279
297
  }
280
298
  let dom = new DOMParser().parseFromString(this.config.login_form, 'text/html').body.childNodes[0];
281
299
  this.config.login_form_class = dom.getAttribute('class').split(' ')[0];
package/package.json CHANGED
@@ -84,7 +84,7 @@
84
84
  },
85
85
  "devDependencies": {},
86
86
  "name": "jwtbutler",
87
- "version": "1.7.8",
87
+ "version": "1.8.3",
88
88
  "description": "",
89
89
  "main": "_js/_build/script.js",
90
90
  "files": [