authentication implementation

This commit is contained in:
HAM!DREZA
2024-05-27 15:13:45 +03:30
parent a984a3937e
commit 021360e364
38 changed files with 1083 additions and 2995 deletions
+18 -1
View File
@@ -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;