n2o / url-shortener

Shorty: The URL Shortener
MIT License
17 stars 15 forks source link

Add custom Login Page #19

Closed n2o closed 1 year ago

n2o commented 4 years ago

The generic view of Spring Security looks a bit boring and we do not know, that this is the landing page of Shorty. We need a logo and a better landing page /login!

chaudharydeepak commented 4 years ago

Hi @n2o , I will be more then happy to help out. Let me know how you would like to go about this - looking for plain vanilla thymeleaf frontend or possibly reactjs SPA with controller exposing rest api's. Let me know, thanks.

n2o commented 4 years ago

Hey, thanks for your interest. Yesterday @iTitus opened a pull request with the custom login page #21

I do not think, that we need reactjs, SPA or Rest APIs for this small project. This bloats the code and makes it less maintainable. Simplicity matters, especially in small projects like these ones ;-)

You can watch or star this repository. Maybe I will write more issues when there is something on my mind.

iTitus commented 4 years ago

I didn’t add a login page but a landing page. This is still relevant

chaudharydeepak commented 4 years ago

Hi, @iTitus @n2o I see that the application presents a admin login page. For this request, do we need a separate login page still? who will use the login page vs admin page?

iTitus commented 4 years ago

If an unauthorized user tries to access /admin they will be redirected to /login by Spring Security. This page is still the default one provided by Spring Security. It needs some love!

n2o commented 4 years ago

When I wrote this issue, I was already thinking about modifying the login page in a way, that it does make it clear, that the user is visiting Shorty. @iTitus developed an admin-page, which is not really necessary in my opinion.

In my view we do not need a separate landing page and a modified login page. Having a modified login page with the ability to log into the application is sufficient. And the admin page can then get deleted.

iTitus commented 4 years ago

We can merge the login form with the / route.

chaudharydeepak commented 4 years ago

ok. @iTitus @n2o please check out this commit - let me know if this is something you guys looking for.

I forked over to my repo - https://github.com/chaudharydeepak/url-shortener/commit/5d77679a8903cd89702be0073a75f13a567a15bb

n2o commented 4 years ago

Hm seems not to be the idiomatic way. Please stick to the official spring documentation:

https://docs.spring.io/spring-security/site/docs/current/guides/html5/form-javaconfig.html

Also, please do not use own css – bootstrap.css is sufficient You find everything in the official documentation. I do not think that we need custom css. Let's just stick to bootstrap and we're done, happy and mobile ready.