Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/common/EditInformation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ const handlePwChange = () => {
}

const changePw = () => {
router.push('/pw-check')
router.replace('/pw-check')
}

const warningModalToggle = () => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/top-bar/ProfileModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const emit = defineEmits<{
}>()

const handleEdit = () => {
router.push('/edit-information')
router.replace('/edit-information')
emit('close')
}
const openLogoutModal = () => {
Expand All @@ -76,7 +76,7 @@ const openLogoutModal = () => {
const closeLogoutModal = () => {
isModalVisible.value = false
isLogined.value = false
router.push('/login')
router.replace('/login')
}

const handleLogout = async () => {
Expand Down
8 changes: 4 additions & 4 deletions src/components/top-bar/TopBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ onMounted(async () => {

const originUrl = route.path.split('/')[1]
if (info.value.role === 'ROLE_USER') {
if (!PERMITTED_URL.ROLE_USER.includes(originUrl)) router.push('/my-request')
if (!PERMITTED_URL.ROLE_USER.includes(originUrl)) router.replace('/my-request')
} else if (info.value.role === 'ROLE_MANAGER') {
if (!PERMITTED_URL.ROLE_MANAGER.includes(originUrl)) router.push('/my-task')
if (!PERMITTED_URL.ROLE_MANAGER.includes(originUrl)) router.replace('/my-task')
} else if (info.value.role === 'ROLE_ADMIN') {
if (!PERMITTED_URL.ROLE_ADMIN.includes(originUrl)) router.push('/member-management')
if (!PERMITTED_URL.ROLE_ADMIN.includes(originUrl)) router.replace('/member-management')
} else {
if (!PERMITTED_URL.UNKNOWN.includes(originUrl)) router.push('/login')
if (!PERMITTED_URL.UNKNOWN.includes(originUrl)) router.replace('/login')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pw-check와 edit-information은 replace로 잘 변경해주신 것 같은데,
이 부분과 login으로의 replace는 다시 한 번 생각해봐야 할 것 같습니다.

예를 들어 권한이 없는 페이지로 url 입력을 통해 직접 이동하여 위 코드에서 replace가 된다면,
뒤로가기를 눌렀을 때 replace 된 페이지가 아닌 잘못된 페이지로 계속 뒤로가기가 되어
결국 다시 replace가 되는 상황이 생길 수 있을 것 같습니다.

이 부분에 대해서는 내일 프론트엔드끼리 상의 후 맞춰봐야 할 것 같습니다.
일단은 이대로 머지 부탁드립니다!

}
})

Expand Down
2 changes: 1 addition & 1 deletion src/views/PwChangeEmail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const email = ref('')

const closeModal = () => {
isModalVisible.value = !isModalVisible.value
router.push('/login')
router.replace('/login')
}
const closeFailModal = () => {
isFailModalVisible.value = !isFailModalVisible.value
Expand Down