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

#42 - passwordless login #138

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

#42 - passwordless login #138

wants to merge 4 commits into from

Conversation

kamilpiech97
Copy link
Member

@kamilpiech97 kamilpiech97 commented Aug 28, 2024

Should close #42.

Preview:

Screencast.from.29-08-24.12.25.46.webm

@kamilpiech97 kamilpiech97 marked this pull request as ready for review August 29, 2024 10:26
@kamilpiech97 kamilpiech97 requested a review from a team as a code owner August 29, 2024 10:26
Copy link
Member

@EwelinaSkrzypacz EwelinaSkrzypacz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Why I see that <table> attribute in email message?

image

  1. Maybe this button "zaloguj się adresem e-mail" should be in another color?

image

Or maybe we should do design something like on Slack?

image

@kamilpiech97
Copy link
Member Author

  1. Why I see that <table> attribute in email message?

image

  1. Maybe this button "zaloguj się adresem e-mail" should be in another color?

image

Or maybe we should do design something like on Slack?

image

1,2,3 fixed

{
Schema::create("passwordless_attempts", function (Blueprint $table): void {
$table->ulid("id")->primary();
$table->string("email")->unique();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should make it unique?

{
public function handle(string $email, Carbon $time): void
{
Mail::to(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you replace facades with dependency injection (as in other actons)?

Comment on lines +14 to +23
$passwordlessAttempt = PasswordlessAttempt::query()
->where("email", $email)
->where("can_login", true)
->where("expires_at", ">", Carbon::now())
->where("session_id", $sessionId)
->first();

if ($passwordlessAttempt === null) {
return false;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would refactor this to ->sole() instead of ->first().

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

Successfully merging this pull request may close these issues.

Passwordless login
3 participants