Hussein
Hussein
Explore posts from servers
SSolidJS
Created by Hussein on 7/6/2024 in #support
is this a good pattern?
not a popular way to do auth *
29 replies
SSolidJS
Created by Hussein on 7/6/2024 in #support
is this a good pattern?
which is not popular in web
29 replies
SSolidJS
Created by Hussein on 7/6/2024 in #support
is this a good pattern?
in this example they don't redirect from login to home
29 replies
SSolidJS
Created by Hussein on 7/6/2024 in #support
is this a good pattern?
but i will call getUser() in login too right?
29 replies
SSolidJS
Created by Hussein on 7/6/2024 in #support
is this a good pattern?
yeah ik
29 replies
SSolidJS
Created by Hussein on 7/6/2024 in #support
is this a good pattern?
right?
29 replies
SSolidJS
Created by Hussein on 7/6/2024 in #support
is this a good pattern?
so i need 2 caches
29 replies
SSolidJS
Created by Hussein on 7/6/2024 in #support
is this a good pattern?
if i throw a redirect in a cache to redirect from home to login then that'll effect what will happen if you're not logged and in login
29 replies
SSolidJS
Created by Hussein on 7/6/2024 in #support
is this a good pattern?
that means i'd need to create 2 caches for redirection from home to login and to login from home
29 replies
SSolidJS
Created by Hussein on 7/6/2024 in #support
is this a good pattern?
its nothing special
29 replies
SSolidJS
Created by Hussein on 7/6/2024 in #support
is this a good pattern?
export default function Home() {
const user = createAsync(() => getUser());
const shouldRedirect = createMemo(() => !user());

return <>{shouldRedirect() && <Navigate href="/login" />}<p>You're now logged in</p></>;
}
export default function Home() {
const user = createAsync(() => getUser());
const shouldRedirect = createMemo(() => !user());

return <>{shouldRedirect() && <Navigate href="/login" />}<p>You're now logged in</p></>;
}
29 replies
SSolidJS
Created by Hussein on 7/6/2024 in #support
is this a good pattern?
...
29 replies
SSolidJS
Created by Hussein on 7/6/2024 in #support
is this a good pattern?
not because i don't know how to do it
29 replies
SSolidJS
Created by Hussein on 7/6/2024 in #support
is this a good pattern?
"Your OP doesn't address that either" i just provided an empty page that redirects if the user is not logged in lol
29 replies
SSolidJS
Created by Hussein on 7/6/2024 in #support
is this a good pattern?
then login needs to redirect to home if logged in
29 replies
SSolidJS
Created by Hussein on 7/6/2024 in #support
is this a good pattern?
but if getUser is used in both home and login
29 replies
SSolidJS
Created by Hussein on 7/6/2024 in #support
is this a good pattern?
actually the <Suspense> is not needed here
29 replies
SSolidJS
Created by Hussein on 7/6/2024 in #support
is this a good pattern?
or is there a better way to redirect?
29 replies
SSolidJS
Created by Hussein on 7/5/2024 in #support
how do i dedupe requests without `cache`?
when i tried doing that, its either making duplicate requests or not working on hover...
45 replies