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

magic link #1085

Merged
merged 11 commits into from
Dec 17, 2024
Merged

magic link #1085

merged 11 commits into from
Dec 17, 2024

Conversation

kaplanelad
Copy link
Contributor

@@ -26,6 +26,11 @@ pub struct ResetParams {
pub password: String,
}

#[derive(Debug, Deserialize, Serialize)]
Copy link
Contributor

Choose a reason for hiding this comment

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

somehow, only if easy i would add a way to validate an allow list for the emails.
for example, accept only emails from "work domains + gmail". which can avoid people using this to spam with fake emails.
then let the user define the function to validate the requested email (we can leave it open to their judgement)

return format::empty_json();
};

let user = user.into_active_model().create_magic_link(&ctx.db).await?;
Copy link
Contributor

Choose a reason for hiding this comment

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

a user overwriting a user with create_magic_link is a bit confusing
maybe
let mut user
user.create_magic_link(..);

because actually it sets the magic link on the user.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean to create the create_magic_link function under the model?

something like that:

impl Model {
...
   pub async fn create_magic_link(mut self, db: &DatabaseConnection) -> ModelResult<Self> {
        self.into_active_model().create_magic_link(&ctx.db).await?;
    }
}

@jondot jondot added this to the 0.14.0 milestone Dec 17, 2024
@kaplanelad kaplanelad merged commit f5a9032 into master Dec 17, 2024
12 checks passed
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.

2 participants