mirror of
				https://github.com/mickael-kerjean/filestash.git
				synced 2025-11-04 05:27:04 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			26 lines
		
	
	
		
			565 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			565 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
import React, { useEffect } from "react";
 | 
						|
 | 
						|
import { Session } from "../model/";
 | 
						|
import { Loader, ErrorPage } from "../components/";
 | 
						|
import { cache } from "../helpers/";
 | 
						|
 | 
						|
@ErrorPage
 | 
						|
export class LogoutPage extends React.Component {
 | 
						|
    constructor(props){
 | 
						|
        super(props);
 | 
						|
    }
 | 
						|
 | 
						|
    componentDidMount(){
 | 
						|
        Session.logout().then((res) => {
 | 
						|
            cache.destroy();
 | 
						|
            this.props.history.push("/");
 | 
						|
        }).catch((err) => this.props.error(err));
 | 
						|
    }
 | 
						|
 | 
						|
    render() {
 | 
						|
        return (
 | 
						|
            <div> <Loader /> </div>
 | 
						|
        );
 | 
						|
    }
 | 
						|
}
 |