Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging out after login/refresh #7

Open
continue47 opened this issue Oct 5, 2019 · 1 comment
Open

Logging out after login/refresh #7

continue47 opened this issue Oct 5, 2019 · 1 comment

Comments

@continue47
Copy link

continue47 commented Oct 5, 2019

In the usage example the $steam->logout() function is called which logs out the user after login. I think this is what issue #5 is refering to.

echo "<a href='" . $steam->logout() . "'>Logout</a>";

This is my modified example if anyone has issues like #5:

<?php
session_start();
require __DIR__ . '/vendor/autoload.php';

$config = array(
    'apikey' => 'xxxxxxxxxxxxxxxxx', // Steam API KEY https://steamcommunity.com/dev/apikey
    'domainname' => 'http://localhost:3000', // Displayed domain in the login-screen
    'loginpage' => 'http://localhost:3000/index.php', // Returns to last page if not set
    "logoutpage" => "",
    "skipAPI" => false, // true = dont get the data from steam, just return the steamid64
);

$steam = new Vikas5914\SteamAuth($config);

if(isset($_GET['logout'])){
    $steam->logout();
    echo'Logged out...<br/>';
}

if ($steam->loggedIn()) {
    echo "Hello " . $steam->personaname . "! ";
    echo "<a href='?logout'>Logout</a>";
} else {
    echo "<a href='" . $steam->loginUrl() . "'>Login</a>";
}

echo $steam->debug();
?>
@vikas5914
Copy link
Owner

vikas5914 commented Oct 5, 2019

The code in the readme was just an example code. But I think you are right, I should at least mention it or update the example code, so people don't get confused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants