@ctx-core/auth0-ui 13.0.1 → 14.0.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 (46) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/package.json +16 -43
  3. package/src/auth0__script__html_/index.d.ts +6 -0
  4. package/src/{auth0__script__html_.ts → auth0__script__html_/index.js} +4 -6
  5. package/src/auth0__ui__o_key/index.d.ts +1 -0
  6. package/src/{auth0__ui__o_key.ts → auth0__ui__o_key/index.js} +0 -0
  7. package/src/index.d.ts +2 -0
  8. package/src/index.js +2 -0
  9. package/.swcrc +0 -10
  10. package/lib/auth0__script__html_.js +0 -35
  11. package/lib/auth0__script__html_.js.map +0 -1
  12. package/lib/auth0__ui__o__getContext.js +0 -7
  13. package/lib/auth0__ui__o__getContext.js.map +0 -1
  14. package/lib/auth0__ui__o_key.js +0 -3
  15. package/lib/auth0__ui__o_key.js.map +0 -1
  16. package/lib/index.js +0 -6
  17. package/lib/index.js.map +0 -1
  18. package/lib/src/auth0__script__html_.d.ts +0 -2
  19. package/lib/src/auth0__ui__o__getContext.d.ts +0 -2
  20. package/lib/src/auth0__ui__o_key.d.ts +0 -1
  21. package/lib/src/index.d.ts +0 -4
  22. package/lib/src/ui/Auth0_c.d.ts +0 -48
  23. package/lib/src/ui/index.d.ts +0 -8
  24. package/lib/ui/Auth0.svelte +0 -168
  25. package/lib/ui/Auth0_Change_Password_Form.svelte +0 -91
  26. package/lib/ui/Auth0_Dialog_Close.svelte +0 -9
  27. package/lib/ui/Auth0_Forgot_Password_Check_Email_Form.svelte +0 -10
  28. package/lib/ui/Auth0_Forgot_Password_Form.svelte +0 -61
  29. package/lib/ui/Auth0_Login_Form.svelte +0 -83
  30. package/lib/ui/Auth0_Signup_Form.svelte +0 -117
  31. package/lib/ui/Auth0_c.js +0 -172
  32. package/lib/ui/Auth0_c.js.map +0 -1
  33. package/lib/ui/index.js +0 -10
  34. package/lib/ui/index.js.map +0 -1
  35. package/src/auth0__ui__o__getContext.ts +0 -6
  36. package/src/index.ts +0 -4
  37. package/src/ui/Auth0.svelte +0 -168
  38. package/src/ui/Auth0_Change_Password_Form.svelte +0 -91
  39. package/src/ui/Auth0_Dialog_Close.svelte +0 -9
  40. package/src/ui/Auth0_Forgot_Password_Check_Email_Form.svelte +0 -10
  41. package/src/ui/Auth0_Forgot_Password_Form.svelte +0 -61
  42. package/src/ui/Auth0_Login_Form.svelte +0 -83
  43. package/src/ui/Auth0_Signup_Form.svelte +0 -117
  44. package/src/ui/Auth0_c.ts +0 -251
  45. package/src/ui/index.ts +0 -8
  46. package/svelte.config.js +0 -16
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @ctx-core/auth0-ui
2
2
 
3
+ ## 14.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - extracted svelte components into @ctx-core/auth0-ui-svelte
8
+
3
9
  ## 13.0.1
4
10
 
5
11
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ctx-core/auth0-ui",
3
- "version": "13.0.1",
3
+ "version": "14.0.0",
4
4
  "description": "ctx-core auth0 ui component & express endpoints",
5
5
  "keywords": [
6
6
  "ctx-core",
@@ -17,45 +17,19 @@
17
17
  "license": "Apache-2.0",
18
18
  "author": "Brian Takita",
19
19
  "type": "module",
20
- "svelte": "./lib/index.js",
21
- "types": "./lib/index.d.ts",
20
+ "types": "./src/index.d.ts",
21
+ "svelte": "./src/index.js",
22
22
  "exports": {
23
- ".": "./lib/index.js",
23
+ ".": "./src/index.js",
24
24
  "./package.json": "./package.json"
25
25
  },
26
- "dependencies": {
27
- "@ctx-core/auth0": "^35.1.7",
28
- "@ctx-core/auth0-management": "^9.1.8",
29
- "@ctx-core/dialog": "^20.1.35",
30
- "@ctx-core/dialog-ui-svelte": "^1.0.46",
31
- "@ctx-core/dom": "^11.2.33",
32
- "@ctx-core/error": "^11.6.0",
33
- "@ctx-core/fetch-undici": "^2.3.72",
34
- "@ctx-core/function": "^21.6.1",
35
- "@ctx-core/http": "^9.1.2",
36
- "@ctx-core/jwt": "^10.2.0",
37
- "@ctx-core/logger": "^9.0.49",
38
- "@ctx-core/object": "^24.1.4",
39
- "@ctx-core/svelte": "^13.4.24",
40
- "@swc/cli": "^0.1.61",
41
- "@swc/core": "^1.3.32",
42
- "auth0-js": "^9.20.1",
43
- "jsonwebtoken": "^9.0.0",
44
- "polka": "next"
45
- },
26
+ "dependencies": {},
46
27
  "devDependencies": {
47
- "@sveltejs/adapter-auto": "next",
48
- "@sveltejs/kit": "next",
49
- "@types/auth0-js": "^9.14.7",
50
- "@types/jsonwebtoken": "^9.0.1",
51
- "@types/trouter": "^3.1.1",
52
- "rimraf": "^4.1.2",
53
- "svelte": "^3.55.1",
54
- "svelte-check": "^3.0.3",
55
- "svelte-preprocess": "^5.0.1",
56
- "svelte2tsx": "^0.6.1",
57
- "tslib": "^2.5.0",
58
- "typescript": "next"
28
+ "c8": "^7.12.0",
29
+ "check-dts": "^0.7.0",
30
+ "tsx": "^3.12.3",
31
+ "typescript": "next",
32
+ "uvu": "^0.5.6"
59
33
  },
60
34
  "publishConfig": {
61
35
  "access": "public",
@@ -63,12 +37,11 @@
63
37
  },
64
38
  "sideEffects": false,
65
39
  "scripts": {
66
- "build": "npm run compile",
67
- "clean": "rimraf lib && npm run clean:tsbuildinfo",
68
- "clean:tsbuildinfo": "rimraf tsconfig.tsbuildinfo && rimraf lib/**/*.d.ts",
69
- "compile": "npm run compile:source && npm run compile:declaration",
70
- "compile:source": "swc src --out-dir lib --copy-files --source-maps --config-file .swcrc",
71
- "compile:declaration": "npm run clean:tsbuildinfo && tsc --declaration --emitDeclarationOnly --declarationDir lib",
72
- "exec": "$@"
40
+ "build": ":",
41
+ "clean": ":",
42
+ "exec": "$@",
43
+ "test": "pnpm test-unit && check-dts",
44
+ "test-unit": "tsx node_modules/uvu/bin.js . '\\.test\\.(ts|js)$'",
45
+ "test-unit-coverage": "c8 pnpm test-unit"
73
46
  }
74
47
  }
@@ -0,0 +1,6 @@
1
+ export declare function auth0__script__html_():string
2
+ export {
3
+ auth0__script__html_ as auth_script_html_,
4
+ auth0__script__html_ as _auth_script_html,
5
+ auth0__script__html_ as _html__script__auth,
6
+ }
@@ -1,4 +1,4 @@
1
- export function auth0__script__html_():string {
1
+ export function auth0__script__html_() {
2
2
  return `
3
3
  <script>
4
4
  (function() {
@@ -7,11 +7,9 @@ export function auth0__script__html_():string {
7
7
  var search_values = _values(search.substr(1))
8
8
  var hash = location.hash
9
9
  var auth0_token = _values(hash.substr(1))
10
- var auth0_token_json = JSON.stringify(auth0_token)
11
- var redirect_url =
12
- search_values
13
- && search_values.redirect_url
14
- localStorage.setItem('auth0_token_json', auth0_token_json)
10
+ var auth0__token__json = JSON.stringify(auth0_token)
11
+ var redirect_url = search_values && search_values.redirect_url
12
+ localStorage.setItem('auth0__token__json', auth0__token__json)
15
13
  if (redirect_url) {
16
14
  location.href = redirect_url
17
15
  }
@@ -0,0 +1 @@
1
+ export declare const auth0__ui__o_key:unique symbol
package/src/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './auth0__ui__o_key'
2
+ export * from './auth0__script__html_'
package/src/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export * from './auth0__ui__o_key/index.js'
2
+ export * from './auth0__script__html_/index.js'
package/.swcrc DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "jsc": {
3
- "target": "es2020",
4
- "parser": {
5
- "syntax": "typescript",
6
- "tsx": true,
7
- "dynamicImport": true
8
- }
9
- }
10
- }
@@ -1,35 +0,0 @@
1
- export function auth0__script__html_() {
2
- return `
3
- <script>
4
- (function() {
5
- var location = window.location
6
- var search = location.search
7
- var search_values = _values(search.substr(1))
8
- var hash = location.hash
9
- var auth0_token = _values(hash.substr(1))
10
- var auth0_token_json = JSON.stringify(auth0_token)
11
- var redirect_url =
12
- search_values
13
- && search_values.redirect_url
14
- localStorage.setItem('auth0_token_json', auth0_token_json)
15
- if (redirect_url) {
16
- location.href = redirect_url
17
- }
18
- function _values(string) {
19
- var segments = string.split('&')
20
- var values = {}
21
- for (var i=0; i < segments.length; i++) {
22
- var pair = segments[i].split('=')
23
- var key = decodeURIComponent(pair[0])
24
- var value = decodeURIComponent(pair[1])
25
- values[key] = value
26
- }
27
- return values
28
- }
29
- })()
30
- </script>
31
- `.trim();
32
- }
33
- export { auth0__script__html_ as auth_script_html_, auth0__script__html_ as _auth_script_html, auth0__script__html_ as _html__script__auth, };
34
-
35
- //# sourceMappingURL=auth0__script__html_.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/auth0__script__html_.ts"],"sourcesContent":["export function auth0__script__html_():string {\n\treturn `\n<script>\n\t(function() {\n\t\tvar location = window.location\n\t\tvar search = location.search\n\t\tvar search_values = _values(search.substr(1))\n\t\tvar hash = location.hash\n\t\tvar auth0_token = _values(hash.substr(1))\n\t\tvar auth0_token_json = JSON.stringify(auth0_token)\n\t\tvar redirect_url =\n\t\t\t\t\tsearch_values\n\t\t\t\t\t&& search_values.redirect_url\n\t\tlocalStorage.setItem('auth0_token_json', auth0_token_json)\n\t\tif (redirect_url) {\n\t\t\tlocation.href = redirect_url\n\t\t}\n\t\tfunction _values(string) {\n\t\t\tvar segments = string.split('&')\n\t\t\tvar values = {}\n\t\t\tfor (var i=0; i < segments.length; i++) {\n\t\t\t\tvar pair = segments[i].split('=')\n\t\t\t\tvar key = decodeURIComponent(pair[0])\n\t\t\t\tvar value = decodeURIComponent(pair[1])\n\t\t\t\tvalues[key] = value\n\t\t\t}\n\t\t\treturn values\n\t\t}\n\t})()\n</script>\n\t`.trim()\n}\nexport {\n\tauth0__script__html_ as auth_script_html_,\n\tauth0__script__html_ as _auth_script_html,\n\tauth0__script__html_ as _html__script__auth,\n}\n"],"names":["auth0__script__html_","trim","auth_script_html_","_auth_script_html","_html__script__auth"],"mappings":"AAAA,OAAO,SAASA,uBAA8B;IAC7C,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BR,CAAC,CAACC,IAAI;AACP,CAAC;AACD,SACCD,wBAAwBE,iBAAiB,EACzCF,wBAAwBG,iBAAiB,EACzCH,wBAAwBI,mBAAmB,KAC3C"}
@@ -1,7 +0,0 @@
1
- import { getContext } from 'svelte';
2
- import { auth0__ui__o_key } from './auth0__ui__o_key.js';
3
- export function auth0__ui__o__getContext() {
4
- return getContext(auth0__ui__o_key);
5
- }
6
-
7
- //# sourceMappingURL=auth0__ui__o__getContext.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/auth0__ui__o__getContext.ts"],"sourcesContent":["import { getContext } from 'svelte'\nimport type { Ctx } from '@ctx-core/object'\nimport { auth0__ui__o_key } from './auth0__ui__o_key.js'\nexport function auth0__ui__o__getContext() {\n return getContext(auth0__ui__o_key) as Ctx\n}\n"],"names":["getContext","auth0__ui__o_key","auth0__ui__o__getContext"],"mappings":"AAAA,SAASA,UAAU,QAAQ,SAAQ;AAEnC,SAASC,gBAAgB,QAAQ,wBAAuB;AACxD,OAAO,SAASC,2BAA2B;IACzC,OAAOF,WAAWC;AACpB,CAAC"}
@@ -1,3 +0,0 @@
1
- export const auth0__ui__o_key = Symbol('auth0__ui__o');
2
-
3
- //# sourceMappingURL=auth0__ui__o_key.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/auth0__ui__o_key.ts"],"sourcesContent":["export const auth0__ui__o_key = Symbol('auth0__ui__o')\n"],"names":["auth0__ui__o_key","Symbol"],"mappings":"AAAA,OAAO,MAAMA,mBAAmBC,OAAO,gBAAe"}
package/lib/index.js DELETED
@@ -1,6 +0,0 @@
1
- export * from './auth0__ui__o_key.js';
2
- export * from './auth0__script__html_.js';
3
- export * from './auth0__ui__o__getContext.js';
4
- export * from './ui/index.js';
5
-
6
- //# sourceMappingURL=index.js.map
package/lib/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './auth0__ui__o_key.js'\nexport * from './auth0__script__html_.js'\nexport * from './auth0__ui__o__getContext.js'\nexport * from './ui/index.js'\n"],"names":[],"mappings":"AAAA,cAAc,wBAAuB;AACrC,cAAc,4BAA2B;AACzC,cAAc,gCAA+B;AAC7C,cAAc,gBAAe"}
@@ -1,2 +0,0 @@
1
- export declare function auth0__script__html_(): string;
2
- export { auth0__script__html_ as auth_script_html_, auth0__script__html_ as _auth_script_html, auth0__script__html_ as _html__script__auth, };
@@ -1,2 +0,0 @@
1
- import type { Ctx } from '@ctx-core/object';
2
- export declare function auth0__ui__o__getContext(): Ctx;
@@ -1 +0,0 @@
1
- export declare const auth0__ui__o_key: unique symbol;
@@ -1,4 +0,0 @@
1
- export * from './auth0__ui__o_key.js';
2
- export * from './auth0__script__html_.js';
3
- export * from './auth0__ui__o__getContext.js';
4
- export * from './ui/index.js';
@@ -1,48 +0,0 @@
1
- import type { auth0__client_id__body_T, auth0__grant_type__body_T, auth0__login_data_T, password_realm__body_T, auth0__oauth_token__fetch__body_T, auth0__passwordless_start__fetch__body_T, auth0__signup_data_T } from '@ctx-core/auth0';
2
- import { noop } from '@ctx-core/function';
3
- import type { Ctx } from '@ctx-core/object';
4
- export declare class Auth0_c {
5
- protected ctx: Ctx;
6
- constructor(ctx: Ctx);
7
- readonly auth0__login__body_: (data: any) => login__password_realm__body_T;
8
- readonly auth0__login__password_realm__body_: (data: any) => login__password_realm__body_T;
9
- readonly auth0__signup__body_: (data: any) => signup__password_realm__body_T;
10
- readonly auth0__signup__password_realm__body_: (data: any) => signup__password_realm__body_T;
11
- readonly auth0__opened__class: import("@ctx-core/nanostores").ReadableAtom_<import("@ctx-core/auth0").auth0_opened_T>;
12
- readonly auth0__token__json_: import("@ctx-core/nanostores").WritableAtom_<string | import("@ctx-core/function").nullish>;
13
- readonly auth0__token__error_: import("@ctx-core/nanostores").WritableAtom_<import("@ctx-core/auth0").auth0_token_error_T>;
14
- readonly auth0__close: () => void;
15
- readonly onMount: (root: HTMLElement) => Promise<void>;
16
- readonly login: (data: auth0__login_data_T, forms__clear__schedule?: () => void) => Promise<void>;
17
- readonly signup: (data: auth0__signup_data_T, forms__clear__schedule?: () => void) => Promise<void>;
18
- readonly change_password: (form: {
19
- password: string;
20
- }, forms__clear__schedule?: () => void) => Promise<void>;
21
- readonly forms__clear__schedule_: (root: HTMLElement) => void;
22
- readonly forms__clear__schedule: (root: HTMLElement) => void;
23
- readonly signup__onsubmit: (event: Event, ctx: signup__onsubmit__o_T, forms__clear__schedule?: () => void) => Promise<false | undefined>;
24
- readonly login__onsubmit: (event: Event, ctx: login__onsubmit__o_T, forms__clear__schedule?: () => void) => Promise<void>;
25
- readonly forgot_password__onsubmit: (event: Event, ctx: forgot_password__onsubmit__o_T) => Promise<void>;
26
- readonly change_password__onsubmit: (event: Event, ctx: change_password__onsubmit__o_T, forms__clear__schedule?: typeof noop) => Promise<void>;
27
- readonly onclose: (event: MouseEvent) => Promise<void>;
28
- }
29
- export interface signup__password_realm__body_T extends auth0__signup_data_T, auth0__client_id__body_T, auth0__passwordless_start__fetch__body_T, password_realm__body_T, auth0__grant_type__body_T, auth0__oauth_token__fetch__body_T {
30
- }
31
- export interface login__password_realm__body_T extends auth0__login_data_T, auth0__client_id__body_T, auth0__passwordless_start__fetch__body_T, password_realm__body_T, auth0__grant_type__body_T, auth0__oauth_token__fetch__body_T {
32
- }
33
- export interface change_password__onsubmit__o_T {
34
- password_input: HTMLInputElement;
35
- password_confirmation_input: HTMLInputElement;
36
- }
37
- export interface forgot_password__onsubmit__o_T {
38
- email_input: HTMLInputElement;
39
- }
40
- export interface login__onsubmit__o_T {
41
- username_login_input: HTMLInputElement;
42
- password_login_input: HTMLInputElement;
43
- }
44
- export interface signup__onsubmit__o_T {
45
- email_input: HTMLInputElement;
46
- password_input: HTMLInputElement;
47
- password_confirmation_input: HTMLInputElement;
48
- }
@@ -1,8 +0,0 @@
1
- import 'svelte';
2
- export * as Auth0 from './Auth0.svelte';
3
- export * as Auth0_Dialog_Close from './Auth0_Dialog_Close.svelte';
4
- export * as Auth0_Change_Password_Form from './Auth0_Change_Password_Form.svelte';
5
- export * as Auth0_Forgot_Password_Check_Email_Form from './Auth0_Forgot_Password_Check_Email_Form.svelte';
6
- export * as Auth0_Forgot_Password_Form from './Auth0_Forgot_Password_Form.svelte';
7
- export * as Auth0_Login_Form from './Auth0_Login_Form.svelte';
8
- export * as Auth0_Signup_Form from './Auth0_Signup_Form.svelte';
@@ -1,168 +0,0 @@
1
- <script lang="ts">
2
- import { setContext } from 'svelte'
3
- import {
4
- auth0__forgot_password__opened__, auth0__opened__class__, auth0__login__opened__, auth0__signup__opened__,
5
- auth0__forgot_password__check_email__opened__, auth0__change_password__opened__
6
- } from '@ctx-core/auth0'
7
- import { ctx_ } from '@ctx-core/object'
8
- import { auth0__ui__o_key } from '../auth0__ui__o_key.js'
9
- import { Auth0_c } from './Auth0_c.js'
10
- import Auth0_Change_Password_Form from './Auth0_Change_Password_Form.svelte'
11
- import Auth0_Dialog_Close from './Auth0_Dialog_Close.svelte'
12
- import Auth0_Forgot_Password_Check_Email_Form from './Auth0_Forgot_Password_Check_Email_Form.svelte'
13
- import Auth0_Forgot_Password_Form from './Auth0_Forgot_Password_Form.svelte'
14
- import Auth0_Login_Form from './Auth0_Login_Form.svelte'
15
- import Auth0_Signup_Form from './Auth0_Signup_Form.svelte'
16
- export let ctx = ctx_(), dialog = false
17
- setContext(auth0__ui__o_key, ctx)
18
- const auth0_change_password_opened_ = auth0__change_password__opened__(ctx)
19
- const auth0_opened_class_ = auth0__opened__class__(ctx)
20
- const auth0_forgot_password_check_email_opened_ = auth0__forgot_password__check_email__opened__(ctx)
21
- const auth0_forgot_password_opened_ = auth0__forgot_password__opened__(ctx)
22
- const auth0_login_opened_ = auth0__login__opened__(ctx)
23
- const auth0_signup_opened_ = auth0__signup__opened__(ctx)
24
- const _ = new Auth0_c(ctx)
25
- </script>
26
-
27
- <div
28
- class="Auth0 {$auth0_opened_class_} {$$props.class || ''}"
29
- class:dialog
30
- class:visible={!!$auth0_opened_class_}
31
- >
32
- <Auth0_Dialog_Close></Auth0_Dialog_Close>
33
- {#if $auth0_login_opened_}
34
- <Auth0_Login_Form {...$$props}></Auth0_Login_Form>
35
- {:else if $auth0_signup_opened_}
36
- <Auth0_Signup_Form {...$$props}>
37
- <div slot="tos__signup"></div>
38
- </Auth0_Signup_Form>
39
- {:else if $auth0_forgot_password_opened_}
40
- <Auth0_Forgot_Password_Form {...$$props}></Auth0_Forgot_Password_Form>
41
- {:else if $auth0_forgot_password_check_email_opened_}
42
- <Auth0_Forgot_Password_Check_Email_Form></Auth0_Forgot_Password_Check_Email_Form>
43
- {:else if $auth0_change_password_opened_}
44
- <Auth0_Change_Password_Form {...$$props}></Auth0_Change_Password_Form>
45
- {/if}
46
- <slot></slot>
47
- </div>
48
-
49
- <style lang="scss">
50
- :global(.Auth0) {
51
- display: block;
52
- overflow: hidden;
53
- &.dialog {
54
- :global(div) {
55
- :global(.close) {
56
- display: block;
57
- }
58
- }
59
- }
60
- :global(h1) {
61
- font-size: 2rem;
62
- text-align: center;
63
- }
64
- [name=auth_navigation] {
65
- display: none;
66
- ~ .form {
67
- display: none;
68
- }
69
- &.auth_navigation-signup:checked {
70
- ~ .signup {
71
- display: block;
72
- }
73
- }
74
- &.auth_navigation-login:checked {
75
- ~ .login {
76
- display: block;
77
- }
78
- }
79
- &.auth_navigation-forgot_password:checked {
80
- ~ .forgot_password {
81
- display: block;
82
- }
83
- }
84
- &.auth_navigation-forgot_password_check_email:checked {
85
- ~ .forgot_password_check_email {
86
- display: block;
87
- }
88
- }
89
- &.auth_navigation-change_password:checked {
90
- ~ .change_password {
91
- display: block;
92
- }
93
- }
94
- }
95
- :global(label.auth_navigation) {
96
- color: #3EBBC0;
97
- font-weight: bold;
98
- &:hover {
99
- text-decoration: underline;
100
- }
101
- }
102
- > :global(div) {
103
- position: relative;
104
- height: 100%;
105
- > :global(.close) {
106
- display: none;
107
- position: absolute;
108
- right: 0;
109
- }
110
- }
111
- :global(form) {
112
- :global(input) {
113
- line-height: 1.8rem;
114
- border-color: transparent;
115
- border-bottom: 2px solid lightgrey;
116
- &.invalid {
117
- border-color: red;
118
- }
119
- }
120
- :global(label) {
121
- display: block;
122
- }
123
- :global(fieldset) {
124
- clear: both;
125
- border: none;
126
- :global(.field) {
127
- width: 20em;
128
- margin: 0 auto;
129
- display: block;
130
- clear: both;
131
- text-align: left;
132
- :global(input) {
133
- display: block;
134
- width: 100%;
135
- padding: 0.2em;
136
- color: black;
137
- }
138
- }
139
- :global(p) {
140
- margin-bottom: 0;
141
- -webkit-margin-after: 0;
142
- }
143
- }
144
- :global(footer) {
145
- margin-top: 1rem;
146
- text-align: center;
147
- :global(.button) {
148
- float: none;
149
- width: 10em;
150
- padding: 0.4rem;
151
- color: white;
152
- background-color: #3EBBC0;
153
- border-radius: 5px;
154
- border: none;
155
- &:hover {
156
- background-color: #5CC6CA;
157
- }
158
- }
159
- :global(label) {
160
- margin-top: 1em;
161
- }
162
- }
163
- }
164
- :global(.error) {
165
- color: red;
166
- }
167
- }
168
- </style>
@@ -1,91 +0,0 @@
1
- <script lang="ts">
2
- import { createEventDispatcher } from 'svelte'
3
- import { AUTH0_DOMAIN__, auth0__token__error__ } from '@ctx-core/auth0'
4
- import { auth0__ui__o__getContext } from '../auth0__ui__o__getContext.js'
5
- import { Auth0_c } from './Auth0_c.js'
6
- import Auth0_Dialog_Close from './Auth0_Dialog_Close.svelte'
7
- const ctx = auth0__ui__o__getContext()
8
- const dispatch = createEventDispatcher()
9
- export let error_class = '', input_class = '', button_class = '', label_class = '.js'
10
- const AUTH0_DOMAIN_ = AUTH0_DOMAIN__(ctx)
11
- const auth0__token__error_ = auth0__token__error__(ctx)
12
- const _ = new Auth0_c(ctx)
13
- let root:HTMLDivElement
14
- let password_input:HTMLInputElement
15
- let password_confirmation_input
16
- let password_error:any|undefined //region
17
- $: password_error = $auth0_token_error_?.password //endregion
18
- let password_error_confirmation:string|undefined //region
19
- $: password_error_confirmation = $auth0_token_error_?.password_confirmation //endregion
20
- async function change_password__onsubmit(event:FormDataEvent) {
21
- dispatch('submit__start')
22
- try {
23
- await _.change_password__onsubmit(event, {
24
- password_input,
25
- password_confirmation_input,
26
- }, ()=>_.forms__clear__schedule(root))
27
- dispatch('success')
28
- } catch (error) {
29
- dispatch('error', { error })
30
- throw error
31
- } finally {
32
- dispatch('submit__end')
33
- }
34
- }
35
- </script>
36
-
37
- <div bind:this={root} class="form change_password Auth0_Change_Password_Form">
38
- <Auth0_Dialog_Close></Auth0_Dialog_Close>
39
- <h1>Change Password</h1>
40
- <form
41
- action="https://{$AUTH0_DOMAIN_}/dbconnections/change_password"
42
- accept-charset="UTF-8"
43
- method="post"
44
- on:submit|preventDefault={change_password__onsubmit}
45
- >
46
- {#if $auth0_token_error_}
47
- <ul>
48
- {#if password_error}
49
- <li class="error {error_class}">
50
- {password_error}
51
- </li>
52
- {/if}
53
- {#if password_error_confirmation}
54
- <li class="error {error_class}">
55
- {password_error_confirmation}
56
- </li>
57
- {/if}
58
- </ul>
59
- {/if}
60
- <fieldset>
61
- <label class="field">
62
- <div class={label_class}>Password</div>
63
- <input
64
- bind:this={password_input}
65
- placeholder="**********"
66
- required="required"
67
- class={input_class}
68
- class:invalid={password_error}
69
- id="password-change_password"
70
- type="password"
71
- name="password"/>
72
- </label>
73
- <label class="field">
74
- <div class={label_class}>Confirm Password</div>
75
- <input
76
- bind:this={password_confirmation_input}
77
- type="password"
78
- id="password_confirmation-change_password"
79
- name="password_confirmation"
80
- class={input_class}
81
- class:invalid={password_error_confirmation}
82
- required="required"
83
- placeholder="**********"
84
- />
85
- </label>
86
- </fieldset>
87
- <footer>
88
- <input type="submit" value="Change Password" class="button {button_class}"/>
89
- </footer>
90
- </form>
91
- </div>
@@ -1,9 +0,0 @@
1
- <script lang="ts">
2
- import { CloseDialogHandle } from '@ctx-core/dialog-ui-svelte'
3
- import { auth0__ui__o__getContext } from '../auth0__ui__o__getContext.js'
4
- import { Auth0_c } from './Auth0_c.js'
5
- const ctx = auth0__ui__o__getContext()
6
- const _ = new Auth0_c(ctx)
7
- </script>
8
-
9
- <CloseDialogHandle on:click={_.onclose}></CloseDialogHandle>
@@ -1,10 +0,0 @@
1
- <script lang="ts">
2
- import Auth0_Dialog_Close from './Auth0_Dialog_Close.svelte'
3
- let root:HTMLDivElement
4
- </script>
5
-
6
- <div bind:this={root} class="form forgot_password_check_email">
7
- <Auth0_Dialog_Close></Auth0_Dialog_Close>
8
- <h1>Check Your Email</h1>
9
- <p>An email to reset you password has been sent to you.</p>
10
- </div>
@@ -1,61 +0,0 @@
1
- <script lang="ts">
2
- import { AUTH0_DOMAIN__, auth0__token__error__, auth0__login__open, auth0__signup__open } from '@ctx-core/auth0'
3
- import { auth0__ui__o__getContext } from '../auth0__ui__o__getContext.js'
4
- import { Auth0_c } from './Auth0_c.js'
5
- import Auth0_Dialog_Close from './Auth0_Dialog_Close.svelte'
6
- export let error_class = '', input_class = '', button_class = '', label_class = '.js'
7
- const ctx = auth0__ui__o__getContext()
8
- const AUTH0_DOMAIN_ = AUTH0_DOMAIN__(ctx)
9
- const auth0__token__error_ = auth0__token__error__(ctx)
10
- const _ = new Auth0_c(ctx)
11
- let email_input:HTMLInputElement, error:typeof $auth0_token_error_?.error
12
- $: error = $auth0_token_error_?.error
13
- </script>
14
-
15
- <div class="form forgot_password">
16
- <Auth0_Dialog_Close></Auth0_Dialog_Close>
17
- <h1>Forgot Password</h1>
18
- <form
19
- action="https://{$AUTH0_DOMAIN_}/passwordless/start"
20
- accept-charset="UTF-8"
21
- method="post"
22
- on:submit={event => _.forgot_password__onsubmit(event, { email_input })}
23
- >
24
- {#if $auth0_token_error_}
25
- <ul>
26
- <li class="error {error_class}">
27
- {$auth0_token_error_.error}: {$auth0_token_error_.error_description}
28
- </li>
29
- </ul>
30
- {/if}
31
- <fieldset>
32
- <label class="field">
33
- <div class={label_class}>Email</div>
34
- <input
35
- bind:this={email_input}
36
- placeholder="your@email.com"
37
- required="required"
38
- class="form-control {input_class}"
39
- class:invalid={error}
40
- type="email"
41
- id="email-forgot_password"
42
- name="email"/>
43
- </label>
44
- </fieldset>
45
- <footer>
46
- <input
47
- type="submit"
48
- value="Reset Password"
49
- class="button {button_class}"
50
- />
51
- <label
52
- class="auth_navigation {label_class}"
53
- on:click={()=>auth0__login__open(ctx)}
54
- >Have an account? Log in&hellip;</label>
55
- <label
56
- class="auth_navigation {label_class}"
57
- on:click={()=>auth0__signup__open(ctx)}
58
- >Don't have an account? Signup&hellip;</label>
59
- </footer>
60
- </form>
61
- </div>