pinstripe 0.20.0 → 0.21.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.
@@ -8,9 +8,10 @@ export default {
8
8
  const { ignoreEventsFromChildren = false } = this.data;
9
9
  this.on('click', (event) => {
10
10
  if(ignoreEventsFromChildren && event.target != this) return;
11
+ const { action = 'load', confirm, target = '_self', method = 'GET', href } = { ...this.attributes, ...this.data };
12
+ if(new URL(href, window.location.href).host != window.location.host) return;
11
13
  event.preventDefault();
12
14
  event.stopPropagation();
13
- const { action = 'load', confirm, target = '_self', method = 'GET', href } = { ...this.attributes, ...this.data };
14
15
  if(action == 'load') loadFrame.call(this, confirm, target, method, href);
15
16
  if(action == 'remove') removeFrame.call(this, confirm, target);
16
17
  });
@@ -0,0 +1,11 @@
1
+
2
+ import { Workspace } from '../workspace.js';
3
+
4
+
5
+ const runInNewWorkspace = fn => Workspace.run(fn);
6
+
7
+ export default {
8
+ create(){
9
+ return runInNewWorkspace;
10
+ }
11
+ };
@@ -17,10 +17,12 @@ export default {
17
17
  const user = await this.database.users.where({ email }).first();
18
18
  if(user){
19
19
  const password = await user.generatePassword();
20
- await this.sendMail({
20
+
21
+ this.runInNewWorkspace(({ sendMail }) => sendMail({
21
22
  to: email,
22
23
  subject: 'Your one-time-password',
23
- text: `Your one-time-password: "${password}" - this will be valid for approximately 3 mins.`});
24
+ text: `Your one-time-password: "${password}" - this will be valid for approximately 3 mins.`
25
+ }));
24
26
  }
25
27
  return this.renderHtml`
26
28
  <span data-component="pinstripe-anchor" data-trigger="click" data-href="/sign_in/verify_password?email=${email}"></span>
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "type": "module",
3
3
  "name": "pinstripe",
4
4
  "description": "A slick web framework for Node.js.",
5
- "version": "0.20.0",
5
+ "version": "0.21.0",
6
6
  "author": "Jody Salt",
7
7
  "license": "MIT",
8
8
  "exports": {
@@ -48,5 +48,5 @@
48
48
  "tmp": "^0.2.1",
49
49
  "unionfs": "^4.4.0"
50
50
  },
51
- "gitHead": "325f53ecc2c452b143e370ac67c6364dfd19a24c"
51
+ "gitHead": "06e08e9cfe79fe037e2fb596d7b7971e5de69596"
52
52
  }