sweetpotato.functions.authentication_functions.LOGOUT#
- sweetpotato.functions.authentication_functions.LOGOUT: str = '\nlogout = () => {\n this.removeUserSession()\n .then((tokens) => {\n fetch(\'API_URL/logout/\', {\n method: "POST",\n headers: {\n "Content-Type": "application/json",\n Authorization: `Bearer ${tokens.access}`,\n },\n body: JSON.stringify({\n refresh: tokens.refresh,\n access: tokens.access,\n }),\n }).then((r) => {\n this.setState({access_token: null});\n })\n })\n .catch((error) => {\n console.log(JSON.stringify(error));\n });\n }\n'#
Logout function for authentication.