File tree Expand file tree Collapse file tree 3 files changed +3
-12
lines changed
admin/app/components/signin Expand file tree Collapse file tree 3 files changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ export function SignIn({ className }: SignInProps) {
54
54
variant = "secondary"
55
55
className = "mb-4 w-full"
56
56
onClick = { ( ) => {
57
- window . location . href = `/oauth2/start?rd=/admin/ &obot-auth-provider=default/${ provider . id } ` ;
57
+ window . location . href = `/oauth2/start?rd=${ window . location . pathname } &obot-auth-provider=default/${ provider . id } ` ;
58
58
} }
59
59
>
60
60
< ProviderIcon provider = { provider } size = "md" />
Original file line number Diff line number Diff line change 76
76
<div class =" mt-32 flex flex-col items-center gap-4" >
77
77
{#each authProviders as provider }
78
78
<a
79
- onclick ={() => {
80
- window .location .href =
81
- ' /oauth2/start?rd=' +
82
- window .location .pathname +
83
- ' &obot-auth-provider=' +
84
- provider .namespace +
85
- ' /' +
86
- provider .id ;
87
- }}
88
79
rel =" external"
89
- href ={` /oauth2/start?obot-auth-provider=${provider .namespace }/${provider .id }&rd=/ ` }
80
+ href ={` /oauth2/start?rd=${ new URL ( window . location . href ). searchParams . get ( ' rd ' ) || window . location . pathname }& obot-auth-provider=${provider .namespace }/${provider .id } ` }
90
81
class =" group flex items-center gap-1 rounded-full bg-black p-2 px-8 text-lg font-semibold text-white dark:bg-white dark:text-black"
91
82
>
92
83
{#if provider .icon }
Original file line number Diff line number Diff line change 16
16
$effect (() => {
17
17
if (profile .current .unauthorized ) {
18
18
// Redirect to the main page to log in.
19
- window .location .href = ' / ' ;
19
+ window .location .href = ` /?rd=${ window . location . pathname } ` ;
20
20
}
21
21
});
22
22
</script >
You can’t perform that action at this time.
0 commit comments