authentication implementation
This commit is contained in:
+18
-1
@@ -213,7 +213,10 @@
|
||||
پروفایل کاربری
|
||||
</NuxtLink>
|
||||
<p
|
||||
class="px-[0.9vw] gap-[0.6vw] text-primaryGreen flex flex-col md:flex-row !mt-[1.2vw] items-center w-[17.5vw] h-[12.564vw] md:h-[2.969vw] text-[3.19vw] md:text-[0.938vw]"
|
||||
@click="logout"
|
||||
class="px-[0.9vw] gap-[0.6vw]
|
||||
cursor-pointer
|
||||
text-primaryGreen flex flex-col md:flex-row !mt-[1.2vw] items-center w-[17.5vw] h-[12.564vw] md:h-[2.969vw] text-[3.19vw] md:text-[0.938vw]"
|
||||
>
|
||||
<svg
|
||||
class="h-[4.615vw] w-[4.615vw] md:h-[1.406vw] md:w-[1.406vw]"
|
||||
@@ -295,6 +298,20 @@
|
||||
</template>
|
||||
|
||||
|
||||
<script setup>
|
||||
|
||||
const {authUser} = useAuth();
|
||||
|
||||
async function logout(){
|
||||
await useFetch('/api/auth/logout', {
|
||||
headers : useRequestHeaders(['cookie']),
|
||||
method : 'POST'
|
||||
})
|
||||
authUser.value = null;
|
||||
return navigateTo('/')
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.scrol::-webkit-scrollbar {
|
||||
display: none;
|
||||
|
||||
Reference in New Issue
Block a user