3333 v-model =" pw"
3434 placeholder =" 비밀번호를 입력해주세요"
3535 required
36- class =" input-box" />
36+ class =" input-box"
37+ autocomplete =" current-password" />
3738 <div class =" flex flex-col gap-2" >
3839 <button
3940 type =" submit"
6061 placeholder =" 새 비밀번호를 입력해주세요"
6162 required
6263 ref =" passwordInput"
64+ autocomplete =" new-password"
6365 :class =" [
6466 'block w-full px-4 py-4 border rounded focus:outline-none',
6567 isInvalid ? 'border-red-1' : 'border-border-1'
7880 ref =" checkPwInput"
7981 placeholder =" 새 비밀번호를 다시 입력해주세요"
8082 required
83+ autocomplete =" new-password"
8184 :class =" [
8285 'block w-full px-4 py-4 border rounded focus:outline-none',
8386 isDifferent ? 'border-red-1' : 'border-border-1'
108111<script setup lang="ts">
109112import { patchPassword , postPasswordCheck } from ' @/api/auth'
110113import TitleContainer from ' @/components/common/TitleContainer.vue'
111- import { nextTick , ref } from ' vue'
114+ import { nextTick , onMounted , ref } from ' vue'
112115import ModalView from ' @/components/common/ModalView.vue'
113116import { useRouter } from ' vue-router'
117+ import Cookies from ' js-cookie'
114118
115119const isErrorVisible = ref (false )
116120
@@ -134,6 +138,13 @@ const passwordInput = ref<HTMLInputElement | null>(null)
134138const isModalVisible = ref (false )
135139const router = useRouter ()
136140
141+ onMounted (() => {
142+ const refreshToken = Cookies .get (' refreshToken' )
143+ if (! refreshToken ) {
144+ isConfirmed .value = true
145+ }
146+ })
147+
137148const validatePassword = () => {
138149 const regex = / ^ (?=. * [A-Z ] )(?=. * [a-z ] )(?=. * \d )(?=. * [!@#$%^&*()_+{}\[\] :;<>,. ?/~`-] ). {8,20} $ /
139150 isInvalid .value = ! regex .test (newPw .value )
@@ -165,7 +176,12 @@ const handleChange = async () => {
165176
166177const closeModal = () => {
167178 isModalVisible .value = ! isModalVisible .value
168- router .replace (' /edit-information' )
179+ if (Cookies .get (' refreshToken' )) {
180+ router .replace (' /edit-information' )
181+ } else {
182+ Cookies .remove (' accessToken' )
183+ router .replace (' /login' )
184+ }
169185}
170186const closeError = () => {
171187 isErrorVisible .value = ! isErrorVisible .value
0 commit comments