Milk Packet
JCHJava Community | Help. Code. Learn.
•Created by Milk Packet on 7/22/2024 in #java-help
How do I use UserDetailsService properly? Where do I define it exactly?
that helped
9 replies
JCHJava Community | Help. Code. Learn.
•Created by Milk Packet on 7/22/2024 in #java-help
How do I use UserDetailsService properly? Where do I define it exactly?
Thank you very much!
9 replies
JCHJava Community | Help. Code. Learn.
•Created by Milk Packet on 6/15/2024 in #java-help
How to access authenticated user/authentication object on react frontend after logging in?
ill fetch other details like id, name, email, username from a
/me
endpoint on the backend and just modify the isLoggedIn
parameter everytime i submit my form values (from my login page) to true45 replies
JCHJava Community | Help. Code. Learn.
•Created by Milk Packet on 6/15/2024 in #java-help
How to access authenticated user/authentication object on react frontend after logging in?
something like this? (i tried implementing it for the first time so not sure)
45 replies
JCHJava Community | Help. Code. Learn.
•Created by Milk Packet on 6/15/2024 in #java-help
How to access authenticated user/authentication object on react frontend after logging in?
its only the frontend side of auth im worried about
45 replies
JCHJava Community | Help. Code. Learn.
•Created by Milk Packet on 6/15/2024 in #java-help
How to access authenticated user/authentication object on react frontend after logging in?
my apis are already protected using spring security so im not worried about that.
45 replies
JCHJava Community | Help. Code. Learn.
•Created by Milk Packet on 6/15/2024 in #java-help
How to access authenticated user/authentication object on react frontend after logging in?
my entire application (except the login, register and verification pages and backend api) is protected behind authentication. its a social networking application. so, if a user is logged in, they are redirected to the dashboard page which has multiple other sub pages they can visit like events, home feed, announcements, etc. I don't want the user to be able to access those pages if they're not logged in and redirect them to /login instead.
45 replies
JCHJava Community | Help. Code. Learn.
•Created by Milk Packet on 6/15/2024 in #java-help
How to access authenticated user/authentication object on react frontend after logging in?
tanstack has a built in feature to check for protected routes. @Tomasm21
45 replies
JCHJava Community | Help. Code. Learn.
•Created by Milk Packet on 6/15/2024 in #java-help
How to access authenticated user/authentication object on react frontend after logging in?
thats how its setup
45 replies
JCHJava Community | Help. Code. Learn.
•Created by Milk Packet on 6/15/2024 in #java-help
How to access authenticated user/authentication object on react frontend after logging in?
every other route,
login.jsx
in this example
45 replies
JCHJava Community | Help. Code. Learn.
•Created by Milk Packet on 6/15/2024 in #java-help
How to access authenticated user/authentication object on react frontend after logging in?
__root.jsx
45 replies
JCHJava Community | Help. Code. Learn.
•Created by Milk Packet on 6/15/2024 in #java-help
How to access authenticated user/authentication object on react frontend after logging in?
45 replies
JCHJava Community | Help. Code. Learn.
•Created by Milk Packet on 6/15/2024 in #java-help
How to access authenticated user/authentication object on react frontend after logging in?
Here's how I setup my react vite frontend
main.jsx
45 replies
JCHJava Community | Help. Code. Learn.
•Created by Milk Packet on 6/15/2024 in #java-help
How to access authenticated user/authentication object on react frontend after logging in?
im using tanstack's file based routing btw
45 replies
JCHJava Community | Help. Code. Learn.
•Created by Milk Packet on 6/15/2024 in #java-help
How to access authenticated user/authentication object on react frontend after logging in?
ill be back with any doubts xD hope you dont mind
45 replies
JCHJava Community | Help. Code. Learn.
•Created by Milk Packet on 6/15/2024 in #java-help
How to access authenticated user/authentication object on react frontend after logging in?
this helps. thank you very much!
45 replies
JCHJava Community | Help. Code. Learn.
•Created by Milk Packet on 6/15/2024 in #java-help
How to access authenticated user/authentication object on react frontend after logging in?
Ill try using redux global state method for now and see how it goes. thank you!
45 replies
JCHJava Community | Help. Code. Learn.
•Created by Milk Packet on 6/15/2024 in #java-help
How to access authenticated user/authentication object on react frontend after logging in?
all I have is a csrf protection implemented and nothing for XSS 😦
45 replies
JCHJava Community | Help. Code. Learn.
•Created by Milk Packet on 6/15/2024 in #java-help
How to access authenticated user/authentication object on react frontend after logging in?
which one would you suggest? state (with redux tlk cuz thats what i plan to use) or localstorage? not to forget about XSS attacks on localstorage
45 replies
JCHJava Community | Help. Code. Learn.
•Created by Milk Packet on 6/15/2024 in #java-help
How to access authenticated user/authentication object on react frontend after logging in?
oh so everytime I login, I can update the state (say,
isAuthenticated
) to true and when I logout, i can update it to false. i can then use this state to decide whether or not to show the page or redirect to /login
, right?45 replies