Skip to content

Sending a magic link will sometimes fail due to password.Generate generating an invalid password #1761

@klajdi369

Description

@klajdi369

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

Sending a magic link will sometimes fail due to password.Generate generating an invalid password that complies with checkPasswordStrength

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

Using Selfhosted Docker

  1. GOTRUE_PASSWORD_REQUIRED_CHARACTERS: "!@#$%^&*()-_=+<>" to this value in environment under auth (or .env depending on how you are defining it)
  2. Sign up a new user
  3. Send magic link until it fails

Expected behavior

The action should sucessfully send an email with a magic link to the user.

Screenshots

image

System information

  • OS: [Ubuntu 22.04]
  • Browser (if applies) [N/A]
  • Version of supabase-js: [N/A]
  • Version of Node.js: [v20.11.1]

Additional context

Basically this line in /internal/api/magic_link.go
password.Generate(64, 10, 1, false, true)
Generates an invalid value for this line in /internal/api/signup.go
if err := a.checkPasswordStrength(ctx, p.Password); err != nil {

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions