You can log out the global `me.puter` user in workers
hi team, an interesting thing i found in workers
you can log out the global me.puter user by running puter.auth.signOut(), then it won't have access to the puter APIs anymore
router.get('/signout', async ({request}) => {
try {
const result = await me.puter.auth.signOut();
return 'result: ' + result;
} catch (error) {
return 'error: ' + error;
}
});
router.get('/user', async ({request}) => {
try {
const user = JSON.stringify(await me.puter.auth.getUser());
return 'result: ' + user;
} catch (error) {
return 'error: ' + error;
}
});
^ in this code, calling the signout endpoint will result in the /user endpoint not returning the user the way to "log in" back is by redeploying the worker
not sure if this is something expected, but it will be super uncommon for worker devs to log themselves out anyway so i won't be suprised if this is wontfix, but just bringing it up here
@ProgrammerIn-wonderland
I'm guessing this just invalidates the API token
Yeah I think it can be safely disabled in workers
can u disable it?
Yeah