@ctx-core/auth0-ui 10.0.123 → 11.0.1
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/CHANGELOG.md +26 -0
- package/dist/auth0_ui_ctx_I.generated.js.map +1 -1
- package/dist/ui/Auth0.svelte +5 -6
- package/dist/ui/Auth0_Change_Password_Form.svelte +17 -24
- package/dist/ui/Auth0_Dialog_Close.svelte +2 -2
- package/dist/ui/Auth0_Forgot_Password_Check_Email_Form.svelte +1 -1
- package/dist/ui/Auth0_Forgot_Password_Form.svelte +10 -14
- package/dist/ui/Auth0_Loggedin_If.svelte +1 -1
- package/dist/ui/Auth0_Login_Form.svelte +25 -29
- package/dist/ui/Auth0_Signup_Form.svelte +34 -35
- package/dist/ui/Auth0_c.js +8 -8
- package/dist/ui/Auth0_c.js.map +1 -1
- package/package.json +11 -6
- package/src/auth0_ui_ctx_I.generated.ts +2 -12
- package/src/ui/Auth0.svelte +5 -6
- package/src/ui/Auth0_Change_Password_Form.svelte +17 -24
- package/src/ui/Auth0_Dialog_Close.svelte +2 -2
- package/src/ui/Auth0_Forgot_Password_Check_Email_Form.svelte +1 -1
- package/src/ui/Auth0_Forgot_Password_Form.svelte +10 -14
- package/src/ui/Auth0_Loggedin_If.svelte +1 -1
- package/src/ui/Auth0_Login_Form.svelte +25 -29
- package/src/ui/Auth0_Signup_Form.svelte +34 -35
- package/src/ui/Auth0_c.ts +16 -15
- package/dist/node/index.js +0 -8
- package/dist/node/index.js.map +0 -1
- package/dist/node/jwks_cert__b.js +0 -19
- package/dist/node/jwks_cert__b.js.map +0 -1
- package/dist/node/jwks_x5c__b.js +0 -21
- package/dist/node/jwks_x5c__b.js.map +0 -1
- package/dist/node/jwt_token_decoded__b.js +0 -15
- package/dist/node/jwt_token_decoded__b.js.map +0 -1
- package/dist/node/koa_jwt_token_decoded__b.js +0 -18
- package/dist/node/koa_jwt_token_decoded__b.js.map +0 -1
- package/dist/node/verify_jwt_email__b.js +0 -29
- package/dist/node/verify_jwt_email__b.js.map +0 -1
- package/dist/node/verify_jwt_user_id__b.js +0 -15
- package/dist/node/verify_jwt_user_id__b.js.map +0 -1
- package/src/node/index.ts +0 -6
- package/src/node/jwks_cert__b.ts +0 -19
- package/src/node/jwks_x5c__b.ts +0 -21
- package/src/node/jwt_token_decoded__b.ts +0 -15
- package/src/node/koa_jwt_token_decoded__b.ts +0 -19
- package/src/node/verify_jwt_email__b.ts +0 -29
- package/src/node/verify_jwt_user_id__b.ts +0 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @ctx-core/auth0-ui
|
|
2
2
|
|
|
3
|
+
## 11.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
- @ctx-core/http@9.0.0
|
|
14
|
+
- @ctx-core/auth0@26.0.0
|
|
15
|
+
- @ctx-core/jwt@10.0.28
|
|
16
|
+
- @ctx-core/auth0-management@6.0.102
|
|
17
|
+
|
|
18
|
+
## 11.0.0
|
|
19
|
+
|
|
20
|
+
### Major Changes
|
|
21
|
+
|
|
22
|
+
- extracted @ctx-core/auth0-service from @ctx-core/auth0-ui
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- Updated dependencies
|
|
27
|
+
- @ctx-core/http@8.0.0
|
|
28
|
+
|
|
3
29
|
## 10.0.123
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/auth0_ui_ctx_I.generated.ts"],"sourcesContent":["/*\n * This file was generated by `npm run generate_ctx_I_file` in @ctx-core/dev-tools\n*/\
|
|
1
|
+
{"version":3,"sources":["../src/auth0_ui_ctx_I.generated.ts"],"sourcesContent":["/*\n * This file was generated by `npm run generate_ctx_I_file` in @ctx-core/dev-tools\n*/\n\nexport interface auth0_ui_ctx_I {\n\n}"],"names":[],"mappings":"AAAA,EAEE,AAFF;;AAEE,AAFF,EAEE,CAEF,MAAM"}
|
package/dist/ui/Auth0.svelte
CHANGED
|
@@ -4,17 +4,16 @@ import {
|
|
|
4
4
|
auth0_forgot_password_opened$_b, auth0_opened_class$_b, auth0_login_opened$_b, auth0_signup_opened$_b,
|
|
5
5
|
auth0_forgot_password_check_email_opened$_b, auth0_change_password_opened$_b
|
|
6
6
|
} from '@ctx-core/auth0'
|
|
7
|
-
import { auth0_ui_ctx_key } from '../auth0_ui_ctx_key.js'
|
|
8
7
|
import type { auth0_ui_Ctx } from '../auth0_ui_Ctx.js'
|
|
8
|
+
import { auth0_ui_ctx_key } from '../auth0_ui_ctx_key.js'
|
|
9
9
|
import { Auth0_c } from './Auth0_c.js'
|
|
10
10
|
import Auth0_Dialog_Close from './Auth0_Dialog_Close.svelte'
|
|
11
|
-
import Auth0_Login_Form from './Auth0_Login_Form.svelte'
|
|
12
|
-
import Auth0_Signup_Form from './Auth0_Signup_Form.svelte'
|
|
13
|
-
import Auth0_Forgot_Password_Form from './Auth0_Forgot_Password_Form.svelte'
|
|
14
11
|
import Auth0_Forgot_Password_Check_Email_Form from './Auth0_Forgot_Password_Check_Email_Form.svelte'
|
|
15
12
|
import Auth0_Change_Password_Form from './Auth0_Change_Password_Form.svelte'
|
|
16
|
-
|
|
17
|
-
|
|
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 = {} as auth0_ui_Ctx, dialog = false
|
|
18
17
|
setContext(auth0_ui_ctx_key, ctx)
|
|
19
18
|
const auth0_change_password_opened$ = auth0_change_password_opened$_b(ctx)
|
|
20
19
|
const auth0_opened_class$ = auth0_opened_class$_b(ctx)
|
|
@@ -7,31 +7,24 @@ import Auth0_Dialog_Close from './Auth0_Dialog_Close.svelte'
|
|
|
7
7
|
import { Auth0_c } from './Auth0_c.js'
|
|
8
8
|
const ctx = getContext_auth0_ui_ctx() as auth0_ui_Ctx
|
|
9
9
|
const dispatch = createEventDispatcher()
|
|
10
|
-
export let error_class = ''
|
|
11
|
-
export let input_class = ''
|
|
12
|
-
export let button_class = ''
|
|
13
|
-
export let label_class = '.js'
|
|
10
|
+
export let error_class = '', input_class = '', button_class = '', label_class = '.js'
|
|
14
11
|
const AUTH0_DOMAIN$ = AUTH0_DOMAIN$_b(ctx)
|
|
15
12
|
const auth0_token_error$ = auth0_token_error$_b(ctx)
|
|
16
13
|
const _ = new Auth0_c(ctx)
|
|
17
|
-
let root
|
|
18
|
-
let password_input
|
|
14
|
+
let root:HTMLDivElement
|
|
15
|
+
let password_input:HTMLInputElement
|
|
19
16
|
let password_confirmation_input
|
|
20
|
-
let password_error //region
|
|
21
|
-
$: password_error =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
$: password_error_confirmation =
|
|
26
|
-
$auth0_token_error$
|
|
27
|
-
&& $auth0_token_error$.password_confirmation //endregion
|
|
28
|
-
async function in_onsubmit_change_password(event) {
|
|
17
|
+
let password_error:any|undefined //region
|
|
18
|
+
$: password_error = $auth0_token_error$?.password //endregion
|
|
19
|
+
let password_error_confirmation:string|undefined //region
|
|
20
|
+
$: password_error_confirmation = $auth0_token_error$?.password_confirmation //endregion
|
|
21
|
+
async function onsubmit_change_password(event:FormDataEvent) {
|
|
29
22
|
dispatch('submit__start')
|
|
30
23
|
try {
|
|
31
24
|
await _.onsubmit_change_password(event, {
|
|
32
25
|
password_input,
|
|
33
26
|
password_confirmation_input,
|
|
34
|
-
}, _.
|
|
27
|
+
}, ()=>_.schedule_forms_clear(root))
|
|
35
28
|
dispatch('success')
|
|
36
29
|
} catch (error) {
|
|
37
30
|
dispatch('error', { error })
|
|
@@ -42,14 +35,14 @@ async function in_onsubmit_change_password(event) {
|
|
|
42
35
|
}
|
|
43
36
|
</script>
|
|
44
37
|
|
|
45
|
-
<div bind:this=
|
|
38
|
+
<div bind:this={root} class="form change_password Auth0_Change_Password_Form">
|
|
46
39
|
<Auth0_Dialog_Close></Auth0_Dialog_Close>
|
|
47
40
|
<h1>Change Password</h1>
|
|
48
41
|
<form
|
|
49
42
|
action="https://{$AUTH0_DOMAIN$}/dbconnections/change_password"
|
|
50
43
|
accept-charset="UTF-8"
|
|
51
44
|
method="post"
|
|
52
|
-
on:submit|preventDefault=
|
|
45
|
+
on:submit|preventDefault={onsubmit_change_password}
|
|
53
46
|
>
|
|
54
47
|
{#if $auth0_token_error$}
|
|
55
48
|
<ul>
|
|
@@ -67,26 +60,26 @@ async function in_onsubmit_change_password(event) {
|
|
|
67
60
|
{/if}
|
|
68
61
|
<fieldset>
|
|
69
62
|
<label class="field">
|
|
70
|
-
<div class=
|
|
63
|
+
<div class={label_class}>Password</div>
|
|
71
64
|
<input
|
|
72
65
|
bind:this={password_input}
|
|
73
66
|
placeholder="**********"
|
|
74
67
|
required="required"
|
|
75
|
-
class=
|
|
76
|
-
class:invalid=
|
|
68
|
+
class={input_class}
|
|
69
|
+
class:invalid={password_error}
|
|
77
70
|
id="password-change_password"
|
|
78
71
|
type="password"
|
|
79
72
|
name="password"/>
|
|
80
73
|
</label>
|
|
81
74
|
<label class="field">
|
|
82
|
-
<div class=
|
|
75
|
+
<div class={label_class}>Confirm Password</div>
|
|
83
76
|
<input
|
|
84
77
|
bind:this={password_confirmation_input}
|
|
85
78
|
type="password"
|
|
86
79
|
id="password_confirmation-change_password"
|
|
87
80
|
name="password_confirmation"
|
|
88
|
-
class=
|
|
89
|
-
class:invalid=
|
|
81
|
+
class={input_class}
|
|
82
|
+
class:invalid={password_error_confirmation}
|
|
90
83
|
required="required"
|
|
91
84
|
placeholder="**********"
|
|
92
85
|
/>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { CloseDialogHandle } from '@ctx-core/dialog'
|
|
3
|
-
import {
|
|
3
|
+
import type { auth0_ui_Ctx } from '../auth0_ui_Ctx.js'
|
|
4
4
|
import { getContext_auth0_ui_ctx } from '../getContext_auth0_ui_ctx.js'
|
|
5
|
-
import
|
|
5
|
+
import { Auth0_c } from './Auth0_c.js'
|
|
6
6
|
const ctx = getContext_auth0_ui_ctx() as auth0_ui_Ctx
|
|
7
7
|
const _ = new Auth0_c(ctx)
|
|
8
8
|
</script>
|
|
@@ -3,7 +3,7 @@ import Auth0_Dialog_Close from './Auth0_Dialog_Close.svelte'
|
|
|
3
3
|
let root:HTMLDivElement
|
|
4
4
|
</script>
|
|
5
5
|
|
|
6
|
-
<div bind:this=
|
|
6
|
+
<div bind:this={root} class="form forgot_password_check_email">
|
|
7
7
|
<Auth0_Dialog_Close></Auth0_Dialog_Close>
|
|
8
8
|
<h1>Check Your Email</h1>
|
|
9
9
|
<p>An email to reset you password has been sent to you.</p>
|
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { AUTH0_DOMAIN$_b, auth0_token_error$_b, open_auth0_login_b, open_auth0_signup_b } from '@ctx-core/auth0'
|
|
3
|
+
import type { auth0_ui_Ctx } from '../auth0_ui_Ctx.js'
|
|
3
4
|
import { getContext_auth0_ui_ctx } from '../getContext_auth0_ui_ctx.js'
|
|
4
|
-
import type { auth0_ui_Ctx } from '../auth0_ui_Ctx'
|
|
5
|
-
import Auth0_Dialog_Close from './Auth0_Dialog_Close.svelte'
|
|
6
5
|
import { Auth0_c } from './Auth0_c.js'
|
|
7
|
-
|
|
8
|
-
export let input_class = ''
|
|
9
|
-
export let button_class = ''
|
|
10
|
-
export let label_class = '.js'
|
|
6
|
+
import Auth0_Dialog_Close from './Auth0_Dialog_Close.svelte'
|
|
7
|
+
export let error_class = '', input_class = '', button_class = '', label_class = '.js'
|
|
11
8
|
const ctx = getContext_auth0_ui_ctx() as auth0_ui_Ctx
|
|
12
9
|
const AUTH0_DOMAIN$ = AUTH0_DOMAIN$_b(ctx)
|
|
13
10
|
const auth0_token_error$ = auth0_token_error$_b(ctx)
|
|
14
11
|
const open_auth0_login = open_auth0_login_b(ctx)
|
|
15
12
|
const open_auth0_signup = open_auth0_signup_b(ctx)
|
|
16
13
|
const _ = new Auth0_c(ctx)
|
|
17
|
-
let email_input
|
|
18
|
-
|
|
19
|
-
$: email_error = $auth0_token_error$?.email
|
|
14
|
+
let email_input:HTMLInputElement, error:string
|
|
15
|
+
$: error = $auth0_token_error$?.error
|
|
20
16
|
</script>
|
|
21
17
|
|
|
22
18
|
<div class="form forgot_password">
|
|
@@ -26,7 +22,7 @@ $: email_error = $auth0_token_error$?.email
|
|
|
26
22
|
action="https://{$AUTH0_DOMAIN$}/passwordless/start"
|
|
27
23
|
accept-charset="UTF-8"
|
|
28
24
|
method="post"
|
|
29
|
-
on:submit=
|
|
25
|
+
on:submit={event => _.onsubmit_forgot_password(event, { email_input })}
|
|
30
26
|
>
|
|
31
27
|
{#if $auth0_token_error$}
|
|
32
28
|
<ul>
|
|
@@ -37,13 +33,13 @@ $: email_error = $auth0_token_error$?.email
|
|
|
37
33
|
{/if}
|
|
38
34
|
<fieldset>
|
|
39
35
|
<label class="field">
|
|
40
|
-
<div class=
|
|
36
|
+
<div class={label_class}>Email</div>
|
|
41
37
|
<input
|
|
42
38
|
bind:this={email_input}
|
|
43
39
|
placeholder="your@email.com"
|
|
44
40
|
required="required"
|
|
45
41
|
class="form-control {input_class}"
|
|
46
|
-
class:invalid=
|
|
42
|
+
class:invalid={error}
|
|
47
43
|
type="email"
|
|
48
44
|
id="email-forgot_password"
|
|
49
45
|
name="email"/>
|
|
@@ -57,11 +53,11 @@ $: email_error = $auth0_token_error$?.email
|
|
|
57
53
|
/>
|
|
58
54
|
<label
|
|
59
55
|
class="navigation__auth {label_class}"
|
|
60
|
-
on:click=
|
|
56
|
+
on:click={open_auth0_login}
|
|
61
57
|
>Have an account? Log in…</label>
|
|
62
58
|
<label
|
|
63
59
|
class="navigation__auth {label_class}"
|
|
64
|
-
on:click=
|
|
60
|
+
on:click={open_auth0_signup}
|
|
65
61
|
>Don't have an account? Signup…</label>
|
|
66
62
|
</footer>
|
|
67
63
|
</form>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { is_auth0_loggedin$_b, is_auth0_loggedout$_b, } from '@ctx-core/auth0'
|
|
3
|
+
import type { auth0_ui_Ctx } from '../auth0_ui_Ctx.js'
|
|
3
4
|
import { getContext_auth0_ui_ctx } from '../getContext_auth0_ui_ctx.js'
|
|
4
|
-
import type { auth0_ui_Ctx } from '../auth0_ui_Ctx'
|
|
5
5
|
const ctx = getContext_auth0_ui_ctx() as auth0_ui_Ctx
|
|
6
6
|
const is_auth0_loggedin$ = is_auth0_loggedin$_b(ctx)
|
|
7
7
|
const is_auth0_loggedout$ = is_auth0_loggedout$_b(ctx)
|
|
@@ -1,70 +1,66 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import {
|
|
3
|
-
AUTH0_DOMAIN$_b, auth0_token_error$_b,
|
|
3
|
+
AUTH0_DOMAIN$_b, auth0_token_error$_b, auth0_token_error_txt$_b, open_auth0_forgot_password_b, open_auth0_signup_b
|
|
4
4
|
} from '@ctx-core/auth0'
|
|
5
5
|
import type { auth0_ui_Ctx } from '../auth0_ui_Ctx.js'
|
|
6
|
-
import Auth0_Dialog_Close from './Auth0_Dialog_Close.svelte'
|
|
7
6
|
import { Auth0_c } from './Auth0_c.js'
|
|
8
|
-
|
|
9
|
-
export let error_class = ''
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export let label_class = '.js'
|
|
13
|
-
const auth0_token_error = auth0_token_error$_b(ctx)
|
|
14
|
-
const auth0_token_error_txt = auth0_token_error_txt_b(ctx)
|
|
7
|
+
import Auth0_Dialog_Close from './Auth0_Dialog_Close.svelte'
|
|
8
|
+
export let ctx:auth0_ui_Ctx, error_class = '', input_class = '', button_class = '', label_class = '.js'
|
|
9
|
+
const auth0_token_error$ = auth0_token_error$_b(ctx)
|
|
10
|
+
const auth0_token_error_txt$ = auth0_token_error_txt$_b(ctx)
|
|
15
11
|
const AUTH0_DOMAIN = AUTH0_DOMAIN$_b(ctx)
|
|
16
12
|
const open_auth0_signup = open_auth0_signup_b(ctx)
|
|
17
13
|
const open_auth0_forgot_password = open_auth0_forgot_password_b(ctx)
|
|
18
14
|
const _ = new Auth0_c(ctx)
|
|
19
|
-
let root
|
|
20
|
-
let username_login_input, password_login_input
|
|
21
|
-
let
|
|
22
|
-
$:
|
|
23
|
-
let
|
|
24
|
-
$:
|
|
15
|
+
let root:HTMLDivElement
|
|
16
|
+
let username_login_input:HTMLInputElement, password_login_input:HTMLInputElement
|
|
17
|
+
let error_username:string|undefined//region
|
|
18
|
+
$: error_username = $auth0_token_error$?.username //endregion
|
|
19
|
+
let error_password:string|undefined//region
|
|
20
|
+
$: error_password = $auth0_token_error$?.password //endregion
|
|
25
21
|
</script>
|
|
26
22
|
|
|
27
|
-
<div bind:this=
|
|
23
|
+
<div bind:this={root} class="form {$$props.class||''}">
|
|
28
24
|
<Auth0_Dialog_Close></Auth0_Dialog_Close>
|
|
29
25
|
<h1><slot name="login_text">Welcome</slot></h1>
|
|
30
26
|
<form
|
|
31
27
|
action="https://{$AUTH0_DOMAIN}/oauth/token"
|
|
32
28
|
accept-charset="UTF-8"
|
|
33
29
|
method="post"
|
|
34
|
-
on:submit=
|
|
30
|
+
on:submit={event =>
|
|
35
31
|
_.onsubmit_login(event, {
|
|
36
32
|
username_login_input,
|
|
37
33
|
password_login_input
|
|
38
|
-
}, _.
|
|
34
|
+
}, ()=>_.schedule_forms_clear(root))}
|
|
39
35
|
>
|
|
40
|
-
{#if $auth0_token_error_txt}
|
|
36
|
+
{#if $auth0_token_error_txt$}
|
|
41
37
|
<ul>
|
|
42
38
|
<li class="error {error_class}">
|
|
43
|
-
{$auth0_token_error_txt}
|
|
39
|
+
{$auth0_token_error_txt$}
|
|
44
40
|
</li>
|
|
45
41
|
</ul>
|
|
46
42
|
{/if}
|
|
47
43
|
<fieldset>
|
|
48
44
|
<label class="field">
|
|
49
|
-
<div class=
|
|
45
|
+
<div class={label_class}>Email</div>
|
|
50
46
|
<input
|
|
51
|
-
bind:this=
|
|
47
|
+
bind:this={username_login_input}
|
|
52
48
|
placeholder="your@email.com"
|
|
53
49
|
required="required"
|
|
54
50
|
class="form-control {input_class}"
|
|
55
|
-
class:invalid=
|
|
51
|
+
class:invalid={error_username}
|
|
56
52
|
type="email"
|
|
57
53
|
id="username-login"
|
|
58
54
|
name="username"/>
|
|
59
55
|
</label>
|
|
60
56
|
<label class="field">
|
|
61
|
-
<div class=
|
|
57
|
+
<div class={label_class}>Password</div>
|
|
62
58
|
<input
|
|
63
|
-
bind:this=
|
|
59
|
+
bind:this={password_login_input}
|
|
64
60
|
placeholder="**********"
|
|
65
61
|
required="required"
|
|
66
|
-
class=
|
|
67
|
-
class:invalid=
|
|
62
|
+
class={input_class}
|
|
63
|
+
class:invalid={error_password}
|
|
68
64
|
id="password-login"
|
|
69
65
|
type="password"
|
|
70
66
|
name="password"/>
|
|
@@ -78,11 +74,11 @@ $: error__password = $auth0_token_error && $auth0_token_error.password //endregi
|
|
|
78
74
|
/>
|
|
79
75
|
<label
|
|
80
76
|
class="navigation__auth {label_class}"
|
|
81
|
-
on:click=
|
|
77
|
+
on:click={open_auth0_signup}
|
|
82
78
|
>Don't have an account? Signup…</label>
|
|
83
79
|
<label
|
|
84
80
|
class="navigation__auth {label_class}"
|
|
85
|
-
on:click=
|
|
81
|
+
on:click={open_auth0_forgot_password}
|
|
86
82
|
>Forgot Password?</label>
|
|
87
83
|
</footer>
|
|
88
84
|
</form>
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
AUTH0_DOMAIN$_b, auth0_token_error$_b, open_auth0_forgot_password_b, open_auth0_login_b,
|
|
4
|
+
} from '@ctx-core/auth0'
|
|
5
|
+
import type { auth0_ui_Ctx } from '../auth0_ui_Ctx.js'
|
|
3
6
|
import { getContext_auth0_ui_ctx } from '../getContext_auth0_ui_ctx.js'
|
|
4
|
-
import type { auth0_ui_Ctx } from '../auth0_ui_Ctx'
|
|
5
|
-
import Auth0_Dialog_Close from './Auth0_Dialog_Close.svelte'
|
|
6
7
|
import { Auth0_c } from './Auth0_c.js'
|
|
7
|
-
|
|
8
|
-
export let
|
|
9
|
-
export let class__button = ''
|
|
10
|
-
export let class__label = '.js'
|
|
8
|
+
import Auth0_Dialog_Close from './Auth0_Dialog_Close.svelte'
|
|
9
|
+
export let error_class = '', input_class = '', button_class = '', label_class = '.js'
|
|
11
10
|
const ctx = getContext_auth0_ui_ctx() as auth0_ui_Ctx
|
|
12
11
|
const AUTH0_DOMAIN$ = AUTH0_DOMAIN$_b(ctx)
|
|
13
12
|
const auth0_token_error$ = auth0_token_error$_b(ctx)
|
|
@@ -15,13 +14,13 @@ const open_auth0_login = open_auth0_login_b(ctx)
|
|
|
15
14
|
const open_auth0_forgot_password = open_auth0_forgot_password_b(ctx)
|
|
16
15
|
const _ = new Auth0_c(ctx)
|
|
17
16
|
let root, signup_email_input, signup_password_input, signup_password_confirmation_input
|
|
18
|
-
let
|
|
19
|
-
$:
|
|
20
|
-
let
|
|
21
|
-
$:
|
|
22
|
-
let
|
|
23
|
-
$:
|
|
24
|
-
let error_text
|
|
17
|
+
let error_username:string|undefined //region
|
|
18
|
+
$: error_username = $auth0_token_error$?.username //endregion
|
|
19
|
+
let error_password:string|undefined //region
|
|
20
|
+
$: error_password = $auth0_token_error$?.password //endregion
|
|
21
|
+
let error_password_confirmation:string|undefined //region
|
|
22
|
+
$: error_password_confirmation = $auth0_token_error$ && error_password_confirmation //endregion
|
|
23
|
+
let error_text:string
|
|
25
24
|
$: {
|
|
26
25
|
let error_text_a = []
|
|
27
26
|
if ($auth0_token_error$) {
|
|
@@ -40,55 +39,55 @@ $: {
|
|
|
40
39
|
action="https://{$AUTH0_DOMAIN$}/dbconnections/signup"
|
|
41
40
|
accept-charset="UTF-8"
|
|
42
41
|
method="post"
|
|
43
|
-
on:submit=
|
|
42
|
+
on:submit={event =>
|
|
44
43
|
_.onsubmit_signup(event, {
|
|
45
44
|
signup_email_input,
|
|
46
45
|
signup_password_input,
|
|
47
46
|
signup_password_confirmation_input
|
|
48
|
-
}, _.
|
|
49
|
-
}
|
|
47
|
+
}, _.schedule_forms_clear(root))
|
|
48
|
+
}
|
|
50
49
|
>
|
|
51
50
|
{#if $auth0_token_error$}
|
|
52
51
|
<ul>
|
|
53
|
-
<li class="error {
|
|
52
|
+
<li class="error {error_class}">
|
|
54
53
|
{error_text}
|
|
55
54
|
</li>
|
|
56
55
|
</ul>
|
|
57
56
|
{/if}
|
|
58
57
|
<fieldset>
|
|
59
58
|
<label class="field">
|
|
60
|
-
<div class=
|
|
59
|
+
<div class={label_class}>Email</div>
|
|
61
60
|
<input
|
|
62
|
-
bind:this=
|
|
61
|
+
bind:this={signup_email_input}
|
|
63
62
|
placeholder="your@email.com"
|
|
64
63
|
required="required"
|
|
65
64
|
autocomplete="email"
|
|
66
|
-
class="form-control {
|
|
67
|
-
class:invalid=
|
|
65
|
+
class="form-control {input_class}"
|
|
66
|
+
class:invalid={error_username}
|
|
68
67
|
type="email"
|
|
69
68
|
id="email-signup"
|
|
70
69
|
name="email"/>
|
|
71
70
|
</label>
|
|
72
71
|
<label class="field">
|
|
73
|
-
<div class=
|
|
72
|
+
<div class={label_class}>Password</div>
|
|
74
73
|
<input
|
|
75
|
-
bind:this=
|
|
74
|
+
bind:this={signup_password_input}
|
|
76
75
|
placeholder="**********"
|
|
77
76
|
required="required"
|
|
78
|
-
class=
|
|
79
|
-
class:invalid=
|
|
77
|
+
class={input_class}
|
|
78
|
+
class:invalid={error_password}
|
|
80
79
|
id="password-signup"
|
|
81
80
|
type="password"
|
|
82
81
|
name="password"/>
|
|
83
82
|
</label>
|
|
84
83
|
<label class="field">
|
|
85
|
-
<div class=
|
|
84
|
+
<div class={label_class}>Confirm Password</div>
|
|
86
85
|
<input
|
|
87
|
-
bind:this=
|
|
86
|
+
bind:this={signup_password_confirmation_input}
|
|
88
87
|
placeholder="**********"
|
|
89
88
|
required="required"
|
|
90
|
-
class=
|
|
91
|
-
class:invalid=
|
|
89
|
+
class={input_class}
|
|
90
|
+
class:invalid={error_password_confirmation}
|
|
92
91
|
type="password"
|
|
93
92
|
name="password_confirmation"
|
|
94
93
|
id="password_confirmation-signup"/>
|
|
@@ -106,15 +105,15 @@ $: {
|
|
|
106
105
|
<input
|
|
107
106
|
type="submit"
|
|
108
107
|
value="Sign up"
|
|
109
|
-
class="button {
|
|
108
|
+
class="button {button_class}"
|
|
110
109
|
/>
|
|
111
110
|
<label
|
|
112
|
-
class="navigation__auth {
|
|
113
|
-
on:click=
|
|
111
|
+
class="navigation__auth {label_class}"
|
|
112
|
+
on:click={open_auth0_login}
|
|
114
113
|
>Have an account? Log in…</label>
|
|
115
114
|
<label
|
|
116
|
-
class="navigation__auth {
|
|
117
|
-
on:click=
|
|
115
|
+
class="navigation__auth {label_class}"
|
|
116
|
+
on:click={open_auth0_forgot_password}
|
|
118
117
|
>Forgot Password?</label>
|
|
119
118
|
</footer>
|
|
120
119
|
</form>
|
package/dist/ui/Auth0_c.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { onDestroy } from 'svelte';
|
|
2
|
+
import { auth0_body__b, auth0_opened_class$_b, auth0_token_error$_b, auth0_token_json$_b, clear_auth0_token_error_b, close_auth0_b, logout_auth0_token_error_b, open_auth0_forgot_password_check_email_b, open_auth0_login_b, password_realm_body__b, post_auth0_auth_change_password_b, post_auth0_dbconnections_signup_b, post_auth0_oauth_token_b, post_auth0_passwordless_start_b, validate_auth0_change_password, validate_auth0_forgot_password, validate_auth0_signup } from '@ctx-core/auth0';
|
|
2
3
|
import { has_dom, dom_a_ } from '@ctx-core/dom';
|
|
4
|
+
import { noop } from '@ctx-core/function';
|
|
3
5
|
import { subscribe } from '@ctx-core/store';
|
|
4
|
-
import { auth0_body__b, auth0_opened_class$_b, auth0_token_error$_b, auth0_token_json$_b, clear_auth0_token_error_b, close_auth0_b, logout_auth0_token_error_b, open_auth0_forgot_password_check_email_b, open_auth0_login_b, password_realm_body__b, post_auth0_auth_change_password_b, post_auth0_dbconnections_signup_b, post_auth0_oauth_token_b, post_auth0_passwordless_start_b, validate_auth0_change_password, validate_auth0_forgot_password, validate_auth0_signup } from '@ctx-core/auth0';
|
|
5
6
|
export class Auth0_c {
|
|
6
7
|
constructor(ctx1){
|
|
7
8
|
this.ctx = ctx1;
|
|
@@ -58,7 +59,7 @@ export class Auth0_c {
|
|
|
58
59
|
}
|
|
59
60
|
schedule_forms_clear();
|
|
60
61
|
await this.login({
|
|
61
|
-
username: data.
|
|
62
|
+
username: data.username,
|
|
62
63
|
password: data.password
|
|
63
64
|
}, schedule_forms_clear);
|
|
64
65
|
};
|
|
@@ -73,7 +74,7 @@ export class Auth0_c {
|
|
|
73
74
|
if (response.status == 401) {
|
|
74
75
|
this.open_auth0_login();
|
|
75
76
|
const auth0_token_error = {
|
|
76
|
-
|
|
77
|
+
username: 'Authentication Error - Log in'
|
|
77
78
|
};
|
|
78
79
|
this.logout_auth0_token_error(auth0_token_error);
|
|
79
80
|
return;
|
|
@@ -109,11 +110,11 @@ export class Auth0_c {
|
|
|
109
110
|
})=>{
|
|
110
111
|
event.preventDefault();
|
|
111
112
|
const { email_input , password_input , password_confirmation_input , } = ctx;
|
|
112
|
-
const
|
|
113
|
+
const username = email_input.value;
|
|
113
114
|
const password = password_input.value;
|
|
114
115
|
const password_confirmation = password_confirmation_input.value;
|
|
115
116
|
const auth0_token_error = validate_auth0_signup({
|
|
116
|
-
|
|
117
|
+
username,
|
|
117
118
|
password,
|
|
118
119
|
password_confirmation
|
|
119
120
|
});
|
|
@@ -122,7 +123,7 @@ export class Auth0_c {
|
|
|
122
123
|
return false;
|
|
123
124
|
}
|
|
124
125
|
await this.signup({
|
|
125
|
-
|
|
126
|
+
username,
|
|
126
127
|
password
|
|
127
128
|
}, schedule_forms_clear);
|
|
128
129
|
return;
|
|
@@ -155,8 +156,7 @@ export class Auth0_c {
|
|
|
155
156
|
await this.post_auth0_passwordless_start(this.login_auth0_body_(data));
|
|
156
157
|
this.open_auth0_forgot_password_check_email();
|
|
157
158
|
};
|
|
158
|
-
this.onsubmit_change_password = async (event, ctx, schedule_forms_clear =
|
|
159
|
-
})=>{
|
|
159
|
+
this.onsubmit_change_password = async (event, ctx, schedule_forms_clear = noop)=>{
|
|
160
160
|
event.preventDefault();
|
|
161
161
|
const { password_input , password_confirmation_input , } = ctx;
|
|
162
162
|
const password = password_input.value;
|