Skip to content

Commit

Permalink
[REFACTOR] #176 - Main page available without login
Browse files Browse the repository at this point in the history
  • Loading branch information
Jwhyee committed Sep 27, 2022
1 parent e22edf0 commit 64c6b49
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 268 deletions.
3 changes: 1 addition & 2 deletions src/main/java/com/matdongsan/infra/SecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ protected void configure(HttpSecurity http) throws Exception {
// 카카오 맵 외부 요청을 받
.csrf().disable() // /api/place 로 보내지지가 않아서 설정
.authorizeRequests()
.mvcMatchers("/login", "/signup", "/account/idCheck", "/account/kakao/**").permitAll() // 누구나 접근 가능
.antMatchers("/manager/*").hasAnyRole("ADMIN") // ADMIN만 접근 가능
.mvcMatchers("/login", "/signup", "/account/idCheck", "/account/kakao/**", "/", "/place", "/place/map", "/posts", "/post/**").permitAll() // 누구나 접근 가능
.anyRequest().authenticated(); // 나머지 요청은 권한이 있어야함
http.logout()
.logoutUrl("/logout")
Expand Down
288 changes: 22 additions & 266 deletions src/main/resources/templates/fragments/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,286 +19,42 @@
<li class="header-nav-item">
<a th:href="@{/post/new}" class="menu-link active">맛집 리뷰 추가</a>
</li>
<!--<li class="header-nav-item">
<a href="#" class="menu-link have-sub">Community</a>
<ul class="mega-menu mega-menu-col-2">
<li>
<ul class="sub-menu">
<li>
<a th:href="@{/}">NewsFeed</a>
</li>
<li>
<a th:href="@{/member/timeline}">Profile Timeline</a>
</li>
<li>
<a th:href="@{/member/about}">Profile About</a>
</li>
<li>
<a href="user-friends.html">Profile Friends</a>
</li>
<li>
<a href="user-groups.html">Profile Group</a>
</li>
<li>
<a href="user-photo.html">Profile Photo</a>
</li>
<li>
<a href="user-video.html">Profile Video</a>
</li>
</ul>
</li>
<li>
<ul class="sub-menu">
<li>
<a href="user-badges.html">Profile Badges</a>
</li>
<li>
<a href="forums.html">Forums</a>
</li>
<li>
<a href="forums-forum.html">Forums Topic</a>
</li>
<li>
<a href="forums-timeline.html">Forums Timeline</a>
</li>
<li>
<a href="forums-info.html">Forums Info</a>
</li>
<li>
<a href="forums-members.html">Forums Members</a>
</li>
<li>
<a href="forums-media.html">Forums Media</a>
</li>
</ul>
</li>
</ul>
</li>-->
<!--<li class="header-nav-item">
<a href="#" class="menu-link have-sub">Pages</a>
<ul class="sub-menu">
<li>
<a href="about-us.html">About</a>
</li>
<li>
<a href="user-blog.html">Blog</a>
</li>
<li>
<a href="shop.html">Shop</a>
</li>
<li>
<a href="single-blog.html">Blog Details</a>
</li>
<li>
<a href="single-shop.html">Shop Details</a>
</li>
<li>
<a href="contact.html">Contact Us</a>
</li>
</ul>
</li>-->
</ul>
</nav>
</div>
<div class="nav-item header-control">
<!--<div class="inline-item d-none d-md-block">
<div class="input-group">
<input type="text" class="form-control" placeholder="검색어를 입력해주세요.">
<div class="input-group-append">
<button class="submit-btn" type="button"><i class="icofont-search"></i></button>
</div>
</div>
</div>-->
<!--<div class="inline-item d-flex align-items-center">
<div class="dropdown dropdown-friend">
<button class="dropdown-toggle" type="button" data-toggle="dropdown" aria-expanded="false">
<i class="icofont-users-alt-4"></i>
</button>
<div class="dropdown-menu dropdown-menu-right">
<div class="item-heading">
<h6 class="heading-title">Friend Requests</h6>
<div class="heading-btn">
<a href="#">Settings</a>
<a href="#">Mark all as Read</a>
</div>
</div>
<div class="item-body">
<div class="media">
<div class="item-img">
<img src="/media/figure/chat_5.jpg" alt="Notify">
<span class="chat-status offline"></span>
</div>
<div class="media-body">
<h6 class="item-title"><a href="#">Lily Zaman</a></h6>
<p>4 in mutual friends</p>
<div class="btn-area">
<a href="#" class="item-btn"><i class="icofont-plus"></i></a>
<a href="#" class="item-btn"><i class="icofont-minus"></i></a>
</div>
</div>
</div>
<div class="media">
<div class="item-img">
<img src="/media/figure/chat_1.jpg" alt="Notify">
<span class="chat-status online"></span>
</div>
<div class="media-body">
<h6 class="item-title"><a href="#">Ketty Rose</a></h6>
<p>3 in mutual friends</p>
<div class="btn-area">
<a href="#" class="item-btn"><i class="icofont-plus"></i></a>
<a href="#" class="item-btn"><i class="icofont-minus"></i></a>
</div>
</div>
</div>
<div class="media">
<div class="item-img">
<img src="/media/figure/chat_8.jpg" alt="Notify">
<span class="chat-status online"></span>
</div>
<div class="media-body">
<h6 class="item-title"><a href="#">Rustom vai</a></h6>
<p>6 in mutual friends</p>
<div class="btn-area">
<a href="#" class="item-btn"><i class="icofont-plus"></i></a>
<a href="#" class="item-btn"><i class="icofont-minus"></i></a>
</div>
</div>
</div>
</div>
<div class="item-footer">
<a href="#" class="view-btn">View All Friend Request</a>
</div>
</div>
</div>
<div class="dropdown dropdown-message">
<button class="dropdown-toggle" type="button" data-toggle="dropdown" aria-expanded="false">
<i class="icofont-speech-comments"></i>
</button>
<div class="dropdown-menu dropdown-menu-right">
<div class="item-heading">
<h6 class="heading-title">Message</h6>
<div class="heading-btn">
<a href="#">Settings</a>
<a href="#">Mark all as Read</a>
</div>
</div>
<div class="item-body">
<a href="#" class="media">
<div class="item-img">
<img src="/media/figure/notifiy_1.png" alt="Notify">
</div>
<div class="media-body">
<h6 class="item-title">Diana Jameson</h6>
<div class="item-time">15 mins ago</div>
<p>when are nknowen printer took galley of types ...</p>
</div>
</a>
<a href="#" class="media">
<div class="item-img">
<img src="/media/figure/notifiy_2.png" alt="Notify">
</div>
<div class="media-body">
<h6 class="item-title">Quirty</h6>
<div class="item-time">15 mins ago</div>
<p>when are nknowen printer took galley of types ...</p>
</div>
</a>
<a href="#" class="media">
<div class="item-img">
<img src="/media/figure/notifiy_3.png" alt="Notify">
</div>
<div class="media-body">
<h6 class="item-title">Zinia Jessy</h6>
<div class="item-time">15 mins ago</div>
<p>when are nknowen printer took galley of types ...</p>
</div>
</a>
</div>
<div class="item-footer">
<a href="#" class="view-btn">View All Messages</a>
</div>
</div>
</div>
<div class="dropdown dropdown-notification">
<button class="dropdown-toggle" type="button" data-toggle="dropdown" aria-expanded="false">
<i class="icofont-notification"></i><span class="notify-count">3</span>
</button>
<div class="dropdown-menu dropdown-menu-right">
<div class="item-heading">
<h6 class="heading-title">Notifications</h6>
<div class="heading-btn">
<a href="#">Settings</a>
<a href="#">Mark all as Read</a>
</div>
</div>
<div class="item-body">
<a href="#" class="media">
<div class="item-img">
<img src="/media/figure/notifiy_1.png" alt="Notify">
</div>
<div class="media-body">
<h6 class="item-title">Diana Jameson</h6>
<div class="item-time">15 mins ago</div>
<p>when are nknowen printer took galley of types ...</p>
</div>
</a>
<a href="#" class="media">
<div class="item-img">
<img src="/media/figure/notifiy_2.png" alt="Notify">
</div>
<div class="media-body">
<h6 class="item-title">Quirty</h6>
<div class="item-time">15 mins ago</div>
<p>when are nknowen printer took galley of types ...</p>
</div>
</a>
<a href="#" class="media">
<div class="item-img">
<img src="/media/figure/notifiy_3.png" alt="Notify">
</div>
<div class="media-body">
<h6 class="item-title">Zinia Jessy</h6>
<div class="item-time">15 mins ago</div>
<p>when are nknowen printer took galley of types ...</p>
</div>
</a>
</div>
<div class="item-footer">
<a href="#" class="view-btn">View All Notification</a>
</div>
</div>
</div>
</div>-->
<div class="inline-item">
<div class="dropdown dropdown-admin">
<button class="dropdown-toggle" type="button" data-toggle="dropdown" aria-expanded="false">
<th:block sec:authorize="!isAuthenticated()">
<a class="text-white" th:href="@{/login}">로그인</a>
</th:block>
<th:block sec:authorize="isAuthenticated()">
<button class="dropdown-toggle" type="button" data-toggle="dropdown" aria-expanded="false">
<span class="media">
<span class="item-img bg-white rounded-circle">
<svg th:data-jdenticon-value="${#authentication.principal.nickname}" width="45" height="45" class="rounded-circle"></svg>
<!--<img src="/media/figure/chat_5.jpg" alt="Chat">-->
<!--<span class="acc-verified"><i class="icofont-check"></i></span>-->
</span>
<span class="media-body">
<span class="item-title" sec:authentication="principal.nickname">닉네임</span>
</span>
</span>
</button>
<div class="dropdown-menu dropdown-menu-right">
<ul class="admin-options">
<li><a th:href="@{/profile/{nickname}(nickname=${#authentication.getName()})}">프로필</a></li>
<li><a th:href="@{/settings/profile}">프로필 설정</a></li>
<li><a th:href="@{/profile/post}">나만의 맛집</a></li>
<li><a th:href="@{/profile/bookmark/view}">북마크 관리</a></li>
<li>
<form action="#" name="logout" th:action="@{/logout}" method="post">
<a href="javascript:logout.submit();">
로그아웃
</a>
</form>
</li>
</ul>
</div>
</button>
<div class="dropdown-menu dropdown-menu-right">
<ul class="admin-options">
<li><a th:href="@{/profile/{nickname}(nickname=${#authentication.getName()})}">프로필</a></li>
<li><a th:href="@{/settings/profile}">프로필 설정</a></li>
<li><a th:href="@{/profile/post}">나만의 맛집</a></li>
<li><a th:href="@{/profile/bookmark/view}">북마크 관리</a></li>
<li>
<form action="#" name="logout" th:action="@{/logout}" method="post">
<a href="javascript:logout.submit();">
로그아웃
</a>
</form>
</li>
</ul>
</div>
</th:block>
</div>
</div>
</div>
Expand Down

0 comments on commit 64c6b49

Please sign in to comment.