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

Fake login on dev #14

Open
g105b opened this issue Nov 20, 2023 · 2 comments
Open

Fake login on dev #14

g105b opened this issue Nov 20, 2023 · 2 comments

Comments

@g105b
Copy link
Member

g105b commented Nov 20, 2023

It's really useful to be able to make a quick login while on development, but it doesn't necessarily need to perform the whole authentication on a remote provider.

It would be useful to be able to perform a fake login that only works on localhost by default.

@g105b
Copy link
Member Author

g105b commented Nov 20, 2023

function example(Authenticator $auth, Uri $uri):void {
	if(!$auth->isLoggedIn() && $uri->getHost() === "localhost") {
		$auth->fakeLogin("the-user-id-to-use");
	}
}

The fakeLogin function would redirect back, as if it were coming from the provider, with a pre-authenticated user of the provided ID.

g105b added a commit that referenced this issue Nov 20, 2023
@g105b
Copy link
Member Author

g105b commented Nov 20, 2023

Needs unit testing before this can be closed.

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

1 participant