Logout
const options = {method: 'DELETE'};
fetch('http://localhost:8000/v1/auth/session', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:8000/v1/auth/session"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}curl --request DELETE \
--url http://localhost:8000/v1/auth/sessionimport requests
url = "http://localhost:8000/v1/auth/session"
response = requests.delete(url)
print(response.text){
"success": true,
"data": null,
"meta": {
"requestId": "<string>",
"timestamp": "<string>"
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"requestId": "<string>",
"timestamp": "<string>"
}
}Session
Logout
Destroy the current session and clear authentication cookies
DELETE
/
v1
/
auth
/
session
Logout
const options = {method: 'DELETE'};
fetch('http://localhost:8000/v1/auth/session', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:8000/v1/auth/session"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}curl --request DELETE \
--url http://localhost:8000/v1/auth/sessionimport requests
url = "http://localhost:8000/v1/auth/session"
response = requests.delete(url)
print(response.text){
"success": true,
"data": null,
"meta": {
"requestId": "<string>",
"timestamp": "<string>"
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"requestId": "<string>",
"timestamp": "<string>"
}
}Was this page helpful?