Skip to content

Commit

Permalink
auth utils
Browse files Browse the repository at this point in the history
  • Loading branch information
SKairinos committed Aug 13, 2024
1 parent fbf2b6f commit cbe5326
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/utils/auth.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Cookies from "js-cookie"

export function logout() {
Cookies.remove("session_key")
Cookies.remove("session_metadata")
}

// https://docs.djangoproject.com/en/3.2/ref/csrf/
export function getCsrfCookie() {
return Cookies.get(`${import.meta.env.VITE_SERVICE_NAME}_csrftoken`)
}

0 comments on commit cbe5326

Please sign in to comment.