mkauthdocs icon indicating copy to clipboard operation
mkauthdocs copied to clipboard

How do you logout using this package?

Open frinzekt opened this issue 4 years ago • 4 comments

How do you logout using this package after logging in?

I presume we could also inject php in html files to create some sort of logout button right?

frinzekt avatar Feb 05 '21 02:02 frinzekt

Bit of a (very) late reply here, but yeah, that's a good point, I could look into that.

CTXz avatar Apr 04 '22 11:04 CTXz

All good man... I have worked out the solution many months ago

Here you go

<?php
session_start();
unset($_SESSION['login']);
header("Location:login.php");
?>

This is the template

Then somewhere in the main.py

## Generate Logout Page ##
def generate_logout_page():
    with open(pkg_resources.resource_filename('mkauthdocs', 'templates/logout_template.php'), 'r') as f:
        template = f.read()
        return template
with open(args.build_dir + '/logout.php', 'w+') as f:
        f.write(generate_logout_page())
        f.close()

frinzekt avatar Apr 04 '22 11:04 frinzekt

Neat, I'll look into merging this hopefully soon then :)

CTXz avatar Apr 04 '22 11:04 CTXz

Any progress on this, or should we consider this project abandoned?

alelom avatar Oct 17 '23 17:10 alelom