-
Notifications
You must be signed in to change notification settings - Fork 4
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
Feat: Email confirmation system #143
base: master
Are you sure you want to change the base?
Conversation
d72a4e8
to
c6f7164
Compare
fefa35a
to
dbf7ab6
Compare
# Conflicts: # frontend/openapi/api/openapi.json # Conflicts: # backend/src/utils/error.rs
… why it doesnt work on gmail
…ed email on /login when parameter redirect_from_confirming is set to true, minor changes and fixes
dbf7ab6
to
cf3139c
Compare
cf3139c
to
b047115
Compare
a2b0e64
to
35aaaa0
Compare
@@ -0,0 +1,92 @@ | |||
<!DOCTYPE html> |
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.
Add comment describing how it was generated
let smtp_client = &app_state.smtp_client; | ||
|
||
let html = self.parse_placeholders()?; | ||
|
||
let logo_attachment = Attachment::new_inline("hack4krak_logo".to_string()).body( | ||
std::fs::read("src/utils/emails_assets/images/hack4krak_logo_black.webp") |
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.
Use tokio, we don't want to lag entire thread :3
"user".to_string(), | ||
"link".to_string(), | ||
"link".to_string(), | ||
"link".to_string(), |
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.
Use replace all, do not define placeholders 3 times
("user".to_string(), register_json.name.clone()), | ||
("link".to_string(), confirmation_link.clone()), | ||
("link".to_string(), confirmation_link.clone()), | ||
("link".to_string(), confirmation_link), |
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.
Same as somewhere else
.await?; | ||
|
||
let confirmation_link = format!( | ||
"{}/{}", |
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.
format!
ain't efficent, use push_srt
use uuid::Uuid as uuid_gen; | ||
|
||
#[derive(Serialize, Deserialize, Debug)] | ||
pub struct UserInfo { |
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.
pub struct UserInfo { | |
pub struct UserInformation { |
ColumnDef::new(EmailConfirmation::ExpirationDate) | ||
.timestamp() | ||
.not_null() | ||
.extra("DEFAULT NOW() + INTERVAL '30 minutes'".to_string()), |
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.
DB shouldn't be responsible for business logic... Move this + 30 to backend
Resolves: #130
Features: