I have decided to learn OAuth2 and try to implement it in to my project but as I'm trying to learn, nothing makes sense, I can't seam to understand how the backend and the frontend communicates with each other, and I'm slowly starting to realize that this isn't going to work, so I'm deciding to ditch the Angular frontend and use some template generator like Thymeleaf just to show of my backend skills. My question is, how difficult would it be to migrate Thymeleaf to an actual frontend like Angular in the future ?
#My frustration is slowly getting over me and I'm on the verge of quitting everything
1 messages · Page 1 of 1 (latest)
<@&987246964494204979> please have a look, thanks.
Here is an AI assisted attempt to answer your question 🤖. Maybe it helps! In any case, a human is on the way 👍. To continue talking to the AI, you can use </chatgpt:1108714622413963314>.
sense to me. I feel overwhelmed and discouraged. I don't know where to start or how to make progress. It's frustrating because I want to understand and succeed, but it feels like an impossible task. I'm losing motivation and questioning if it's even worth it to continue.
you are a single person, so definitionally you only do a single person's worth of work
so worst case, just as long as it takes you to do the thymeleaf version
best case, a lot less since you already did the UI and there is some stuff you can copy paste
It's frustrating because I really want to use Angular, last time you linked me some videos and in most of them they for some reason use a provider like google or GitHub to login, but I just can't find any information about the use of the basic login (no provider) and it's frustrating to the point I want to quit...
Then quit, go outside, play basketball
come back when you are fresh
there is no reason to grind away
I am fresh, I just don't know what I'm looking for, I have the idea, but I need the "How to"
hmm
okay so "basic login, no provider" is the opposite of oauth
oauth is all about "log in with provider"
if you don't want that then things become a lot simpler
ok, let's ditch OAuth2, what do i use instead ? jwt ?
hmm
we can do either JWT or session auth
I would reccomend session auth TBH
so the way this would work is on your server, have a /login route
and we render a form on the page
classic web dev stuff
err
okay your options
- All angular, use JWTs for auth. Store JWT in local storage
- Mostly angular, have the login/register pages rendered in thymelleaf, store auth in session
- No angular, all thymeleaf, store auth in session
i'm not sure how to do All angular, store auth in session
since session stuff is stored in cookies, to set a cookie you need to make a post request through an http form (basically)
and the angular app wouldn't play nice with that
but you can just have a /login http route that returns a JWT
thats fine
When you refer to mostly angular, can't it just be all on angular instead of introducing thymeleaf ?
sure
i'm just not 100% sure the best way to use a session auth then
so JWT would probably be the easiest auth method
I think so too, for learning purposes it would be the best option, I actually had a JWT implementation already, but I deleted it all without fully understanding what OAuth2 is actually used for, and dumb me didn't have a backup on GitHub 
This is relief honestly, thanks for the explanation