@ctx-core/auth0-ui 10.0.122 → 11.0.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/.swcrc +10 -0
- package/CHANGELOG.md +54 -0
- package/dist/auth0_ui_Ctx.js +2 -1
- package/dist/auth0_ui_Ctx.js.map +1 -1
- package/dist/auth0_ui_ctx_I.generated.js +4 -1
- package/dist/auth0_ui_ctx_I.generated.js.map +1 -1
- package/dist/auth0_ui_ctx_key.js +1 -0
- package/dist/auth0_ui_ctx_key.js.map +1 -1
- package/dist/auth_script_html_.js +2 -1
- package/dist/auth_script_html_.js.map +1 -1
- package/dist/getContext_auth0_ui_ctx.js +1 -0
- package/dist/getContext_auth0_ui_ctx.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/ui/Auth0.svelte +168 -0
- package/dist/ui/Auth0_Change_Password_Form.svelte +92 -0
- package/dist/ui/Auth0_Dialog_Close.svelte +10 -0
- package/dist/ui/Auth0_Forgot_Password_Check_Email_Form.svelte +10 -0
- package/dist/ui/Auth0_Forgot_Password_Form.svelte +64 -0
- package/dist/ui/Auth0_Loggedin_If.svelte +14 -0
- package/dist/ui/Auth0_Login_Form.svelte +85 -0
- package/dist/ui/Auth0_Signup_Form.svelte +120 -0
- package/dist/ui/Auth0_c.js +58 -42
- package/dist/ui/Auth0_c.js.map +1 -1
- package/dist/ui/index.js +17 -8
- package/dist/ui/index.js.map +1 -1
- package/package.json +26 -23
- 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/auth0_ui_Ctx.d.ts +0 -9
- package/dist/auth0_ui_ctx_I.generated.d.ts +0 -14
- package/dist/auth0_ui_ctx_key.d.ts +0 -1
- package/dist/auth_script_html_.d.ts +0 -2
- package/dist/browser/auth0_ui_ctx_key.d.ts +0 -1
- package/dist/browser/auth0_ui_ctx_key.js +0 -2
- package/dist/browser/auth0_ui_ctx_key.js.map +0 -1
- package/dist/browser/auth_script_html_.d.ts +0 -2
- package/dist/browser/auth_script_html_.js +0 -34
- package/dist/browser/auth_script_html_.js.map +0 -1
- package/dist/browser/getContext_auth0_ui_ctx.d.ts +0 -1
- package/dist/browser/getContext_auth0_ui_ctx.js +0 -6
- package/dist/browser/getContext_auth0_ui_ctx.js.map +0 -1
- package/dist/browser/index.d.ts +0 -3
- package/dist/browser/index.js +0 -4
- package/dist/browser/index.js.map +0 -1
- package/dist/getContext_auth0_ui_ctx.d.ts +0 -1
- package/dist/index.cjs +0 -1
- package/dist/index.d.ts +0 -6
- package/dist/node/index.d.ts +0 -6
- package/dist/node/index.js +0 -7
- package/dist/node/index.js.map +0 -1
- package/dist/node/jwks_cert__b.d.ts +0 -6
- package/dist/node/jwks_cert__b.js +0 -17
- package/dist/node/jwks_cert__b.js.map +0 -1
- package/dist/node/jwks_x5c__b.d.ts +0 -6
- package/dist/node/jwks_x5c__b.js +0 -20
- package/dist/node/jwks_x5c__b.js.map +0 -1
- package/dist/node/jwt_token_decoded__b.d.ts +0 -6
- package/dist/node/jwt_token_decoded__b.js +0 -14
- package/dist/node/jwt_token_decoded__b.js.map +0 -1
- package/dist/node/koa_jwt_token_decoded__b.d.ts +0 -7
- package/dist/node/koa_jwt_token_decoded__b.js +0 -16
- package/dist/node/koa_jwt_token_decoded__b.js.map +0 -1
- package/dist/node/verify_jwt_email__b.d.ts +0 -6
- package/dist/node/verify_jwt_email__b.js +0 -28
- package/dist/node/verify_jwt_email__b.js.map +0 -1
- package/dist/node/verify_jwt_user_id__b.d.ts +0 -6
- package/dist/node/verify_jwt_user_id__b.js +0 -14
- package/dist/node/verify_jwt_user_id__b.js.map +0 -1
- package/dist/ui/Auth0_c.d.ts +0 -55
- package/dist/ui/index.d.ts +0 -9
- package/src/index.browser.js +0 -4
- 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
|
@@ -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/src/ui/Auth0_c.ts
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
import { onDestroy } from 'svelte'
|
|
2
|
-
import { has_dom, dom_a_ } from '@ctx-core/dom'
|
|
3
|
-
import { subscribe } from '@ctx-core/store'
|
|
4
|
-
import {
|
|
5
|
-
auth0_body__b, auth0_opened_class$_b, auth0_token_error$_b, auth0_token_json$_b, clear_auth0_token_error_b,
|
|
6
|
-
close_auth0_b, logout_auth0_token_error_b, open_auth0_forgot_password_check_email_b, open_auth0_login_b,
|
|
7
|
-
password_realm_body__b, post_auth0_auth_change_password_b, post_auth0_dbconnections_signup_b,
|
|
8
|
-
post_auth0_oauth_token_b, post_auth0_passwordless_start_b, validate_auth0_change_password,
|
|
9
|
-
validate_auth0_forgot_password, validate_auth0_signup
|
|
10
|
-
} from '@ctx-core/auth0'
|
|
11
2
|
import type {
|
|
12
3
|
auth0_body__T, auth0_client_id_body_I, auth0_grant_type_body_I, login_data_I, logout_auth0_token_error_T,
|
|
13
4
|
open_auth0_forgot_password_check_email_T, open_auth0_login_T, password_realm_body__T, password_realm_body_T,
|
|
@@ -15,6 +6,16 @@ import type {
|
|
|
15
6
|
post_auth0_oauth_token_T, post_auth0_passwordless_start_body_T, post_auth0_passwordless_start_optional_body_T,
|
|
16
7
|
post_auth0_passwordless_start_T, signup_data_I
|
|
17
8
|
} from '@ctx-core/auth0'
|
|
9
|
+
import {
|
|
10
|
+
auth0_body__b, auth0_opened_class$_b, auth0_token_error$_b, auth0_token_json$_b, clear_auth0_token_error_b,
|
|
11
|
+
close_auth0_b, logout_auth0_token_error_b, open_auth0_forgot_password_check_email_b, open_auth0_login_b,
|
|
12
|
+
password_realm_body__b, post_auth0_auth_change_password_b, post_auth0_dbconnections_signup_b,
|
|
13
|
+
post_auth0_oauth_token_b, post_auth0_passwordless_start_b, validate_auth0_change_password,
|
|
14
|
+
validate_auth0_forgot_password, validate_auth0_signup
|
|
15
|
+
} from '@ctx-core/auth0'
|
|
16
|
+
import { has_dom, dom_a_ } from '@ctx-core/dom'
|
|
17
|
+
import { noop } from '@ctx-core/function'
|
|
18
|
+
import { subscribe } from '@ctx-core/store'
|
|
18
19
|
import type { auth0_ui_Ctx } from '../auth0_ui_Ctx.js'
|
|
19
20
|
export class Auth0_c {
|
|
20
21
|
constructor(protected ctx:auth0_ui_Ctx) {}
|
|
@@ -97,7 +98,7 @@ export class Auth0_c {
|
|
|
97
98
|
}
|
|
98
99
|
schedule_forms_clear()
|
|
99
100
|
await this.login({
|
|
100
|
-
username: data.
|
|
101
|
+
username: data.username,
|
|
101
102
|
password: data.password,
|
|
102
103
|
}, schedule_forms_clear)
|
|
103
104
|
}
|
|
@@ -110,7 +111,7 @@ export class Auth0_c {
|
|
|
110
111
|
if (!response.ok) {
|
|
111
112
|
if (response.status == 401) {
|
|
112
113
|
this.open_auth0_login()
|
|
113
|
-
const auth0_token_error = {
|
|
114
|
+
const auth0_token_error = { username: 'Authentication Error - Log in' }
|
|
114
115
|
this.logout_auth0_token_error(auth0_token_error)
|
|
115
116
|
return
|
|
116
117
|
}
|
|
@@ -145,12 +146,12 @@ export class Auth0_c {
|
|
|
145
146
|
password_input,
|
|
146
147
|
password_confirmation_input,
|
|
147
148
|
} = ctx
|
|
148
|
-
const
|
|
149
|
+
const username = email_input.value
|
|
149
150
|
const password = password_input.value
|
|
150
151
|
const password_confirmation = password_confirmation_input.value
|
|
151
152
|
const auth0_token_error =
|
|
152
153
|
validate_auth0_signup({
|
|
153
|
-
|
|
154
|
+
username,
|
|
154
155
|
password,
|
|
155
156
|
password_confirmation
|
|
156
157
|
})
|
|
@@ -159,7 +160,7 @@ export class Auth0_c {
|
|
|
159
160
|
return false
|
|
160
161
|
}
|
|
161
162
|
await this.signup({
|
|
162
|
-
|
|
163
|
+
username,
|
|
163
164
|
password
|
|
164
165
|
}, schedule_forms_clear)
|
|
165
166
|
return
|
|
@@ -191,7 +192,7 @@ export class Auth0_c {
|
|
|
191
192
|
this.open_auth0_forgot_password_check_email()
|
|
192
193
|
}
|
|
193
194
|
readonly onsubmit_change_password = async (
|
|
194
|
-
event:Event, ctx:onsubmit_change_password_Ctx, schedule_forms_clear =
|
|
195
|
+
event:Event, ctx:onsubmit_change_password_Ctx, schedule_forms_clear = noop
|
|
195
196
|
)=>{
|
|
196
197
|
event.preventDefault()
|
|
197
198
|
const {
|
package/dist/auth0_ui_Ctx.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { auth0_body__T, auth0_Ctx, password_realm_body__T } from '@ctx-core/auth0';
|
|
2
|
-
import type { auth0_ui_ctx_I } from './auth0_ui_ctx_I.generated.js';
|
|
3
|
-
import type { login_data_password_realm_body_I, signup_data_password_realm_body_I } from './ui/Auth0_c.js';
|
|
4
|
-
export interface auth0_ui_Ctx extends auth0_ui_ctx_I, auth0_Ctx {
|
|
5
|
-
login_auth0_body_: auth0_body__T<login_data_password_realm_body_I>;
|
|
6
|
-
login_password_realm_body_: password_realm_body__T<login_data_password_realm_body_I>;
|
|
7
|
-
signup_auth0_body_: auth0_body__T<signup_data_password_realm_body_I>;
|
|
8
|
-
signup_password_realm_body_fn: password_realm_body__T<signup_data_password_realm_body_I>;
|
|
9
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { jwks_cert__T } from './node/jwks_cert__b.js';
|
|
2
|
-
import type { jwks_x5c__T } from './node/jwks_x5c__b.js';
|
|
3
|
-
import type { jwt_token_decoded__T } from './node/jwt_token_decoded__b.js';
|
|
4
|
-
import type { koa_jwt_token_decoded__T } from './node/koa_jwt_token_decoded__b.js';
|
|
5
|
-
import type { verify_jwt_email__T } from './node/verify_jwt_email__b.js';
|
|
6
|
-
import type { verify_jwt_user_id__T } from './node/verify_jwt_user_id__b.js';
|
|
7
|
-
export interface auth0_ui_ctx_I {
|
|
8
|
-
jwks_cert_?: jwks_cert__T;
|
|
9
|
-
jwks_x5c_?: jwks_x5c__T;
|
|
10
|
-
jwt_token_decoded_?: jwt_token_decoded__T;
|
|
11
|
-
koa_jwt_token_decoded_?: koa_jwt_token_decoded__T;
|
|
12
|
-
verify_jwt_email_?: verify_jwt_email__T;
|
|
13
|
-
verify_jwt_user_id_?: verify_jwt_user_id__T;
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const auth0_ui_ctx_key: unique symbol;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const auth0_ui_ctx_key: unique symbol;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth0_ui_ctx_key.js","sourceRoot":"","sources":["../../browser/auth0_ui_ctx_key.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,cAAc,CAAC,CAAA"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export function auth_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 { auth_script_html_ as _auth_script_html, auth_script_html_ as _html__script__auth, };
|
|
34
|
-
//# sourceMappingURL=../../src/dist/browser/auth_script_html_.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth_script_html_.js","sourceRoot":"","sources":["../../browser/auth_script_html_.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,iBAAiB;IAChC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BN,CAAC,IAAI,EAAE,CAAA;AACT,CAAC;AACD,OAAO,EACN,iBAAiB,IAAI,iBAAiB,EACtC,iBAAiB,IAAI,mBAAmB,GACxC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getContext_auth0_ui_ctx(): unknown;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getContext_auth0_ui_ctx.js","sourceRoot":"","sources":["../../browser/getContext_auth0_ui_ctx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,MAAM,UAAU,uBAAuB;IACrC,OAAO,UAAU,CAAC,gBAAgB,CAAC,CAAA;AACrC,CAAC"}
|
package/dist/browser/index.d.ts
DELETED
package/dist/browser/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../browser/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,8BAA8B,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getContext_auth0_ui_ctx(): unknown;
|
package/dist/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = (async () => import('./index.js'))()
|