File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 import { Heading } from ' $lib/components' ;
55 import { onMount } from ' svelte' ;
66
7- onMount (async () => {
7+ let redirecting = false ;
8+
9+ onMount (() => {
810 const project = $page .url .searchParams .get (' project' );
911 if (project ) {
10- await goto (` appwrite-callback-${project }://${$page .url .search } ` );
12+ redirecting = true ;
13+ setTimeout (async () => {
14+ await goto (` appwrite-callback-${project }://${$page .url .search } ` );
15+ window .close ();
16+ }, 3000 );
1117 }
1218 });
19+
20+ $ : heading = redirecting ? ' Login failed' : ' Missing Redirect URL' ;
1321 </script >
1422
15- <Heading tag =" h1" size =" 1" >Missing Redirect URL</Heading >
16- <p class =" text" >
17- Your OAuth login flow is missing a proper redirect URL. Please check the
18- <a class =" link" href =" https://appwrite.io/docs/client/account?sdk=web#createOAuth2Session"
19- >OAuth docs</a >
20- and send request for new session with a valid callback URL.
21- </p >
23+ <article class =" card u-padding-16" >
24+ <div class =" u-flex u-flex-vertical u-gap-16" >
25+ <Heading tag ="h1" size ="4" >{heading }</Heading >
26+ <p class =" text" >
27+ {#if redirecting }
28+ You will be automatically redirected back to your app shortly.
29+ {:else }
30+ Your OAuth login flow is missing a proper redirect URL. Please check the
31+ <a
32+ class =" link"
33+ href =" https://appwrite.io/docs/client/account?sdk=web#createOAuth2Session"
34+ >OAuth docs</a >
35+ and send request for new session with a valid callback URL.
36+ {/if }
37+ </p >
38+ </div >
39+ </article >
Original file line number Diff line number Diff line change 44 import { Heading } from ' $lib/components' ;
55 import { onMount } from ' svelte' ;
66
7- onMount (async () => {
7+ let redirecting = false ;
8+
9+ onMount (() => {
810 const project = $page .url .searchParams .get (' project' );
911 if (project ) {
10- await goto (` appwrite-callback-${project }://${$page .url .search } ` );
12+ redirecting = true ;
13+ setTimeout (async () => {
14+ await goto (` appwrite-callback-${project }://${$page .url .search } ` );
15+ window .close ();
16+ }, 3000 );
1117 }
1218 });
19+
20+ $ : heading = redirecting ? " You're now logged in" : ' Missing Redirect URL' ;
1321 </script >
1422
15- <Heading tag =" h1" size =" 1" >Missing Redirect URL</Heading >
16- <p class =" text" >
17- Your OAuth login flow is missing a proper redirect URL. Please check the
18- <a class =" link" href =" https://appwrite.io/docs/client/account?sdk=web#createOAuth2Session"
19- >OAuth docs</a >
20- and send request for new session with a valid callback URL.
21- </p >
23+ <article class =" card u-padding-16" >
24+ <div class =" u-flex u-flex-vertical u-gap-16" >
25+ <Heading tag ="h1" size ="4" >{heading }</Heading >
26+ <p class =" text" >
27+ {#if redirecting }
28+ You will be automatically redirected back to your app shortly.
29+ {:else }
30+ Your OAuth login flow is missing a proper redirect URL. Please check the
31+ <a
32+ class =" link"
33+ href =" https://appwrite.io/docs/client/account?sdk=web#createOAuth2Session"
34+ >OAuth docs</a >
35+ and send request for new session with a valid callback URL.
36+ {/if }
37+ </p >
38+ </div >
39+ </article >
You can’t perform that action at this time.
0 commit comments