-
-
Notifications
You must be signed in to change notification settings - Fork 295
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
magic link #1085
Conversation
@@ -26,6 +26,11 @@ pub struct ResetParams { | |||
pub password: String, | |||
} | |||
|
|||
#[derive(Debug, Deserialize, Serialize)] |
There was a problem hiding this comment.
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?; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?;
}
}
#613