-
Notifications
You must be signed in to change notification settings - Fork 82
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
Local kratos email verification with mailslurper #1648
Changes from 6 commits
78593bf
61fe1a5
bb07373
539846e
9ecc234
460834c
38b3db1
e98a86b
75e8521
f710e62
8ff88d9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,18 @@ selfservice: | |
password: | ||
enabled: true | ||
|
||
link: | ||
config: | ||
# The URL for verification emails are set through the link method | ||
# but we're using the code method, so we disable this method for usage. | ||
enabled: false | ||
# Set through SELFSERVICE_METHODS_LINK_CONFIG_BASE_URL | ||
base_url: http://localhost:3000/api/ory | ||
code: | ||
config: | ||
# and make sure to enable the code method. | ||
enabled: true | ||
|
||
flows: | ||
error: | ||
ui_url: http://localhost:3000/error | ||
|
@@ -59,6 +71,13 @@ selfservice: | |
in: header | ||
- hook: session | ||
|
||
verification: | ||
use: code | ||
lifespan: 48h | ||
# Set though SELFSERVICE_FLOWS_VERIFICATION_UI_URL | ||
ui_url: http://localhost:3000/verification | ||
enabled: true | ||
|
||
log: | ||
level: debug | ||
format: text | ||
|
@@ -78,3 +97,8 @@ identity: | |
schemas: | ||
- id: default | ||
url: file:///etc/config/kratos/identity.schema.json | ||
|
||
courier: | ||
template_override_path: /etc/config/kratos/templates | ||
smtp: | ||
connection_uri: set-through-env-arg-COURIER_SMTP_CONNECTION_URI | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you able to set this dummy value because the environment variable overrides whatever we specify in the config? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, exactly, I think for dev mode, we should maybe just let it be the mailslurper url and add a comment as we do for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Your verification code is: {{ .Code }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Hi, | ||
|
||
you (or someone else) entered this email address when trying to recover access to an account. | ||
|
||
However, this email address is not on our database of registered users and therefore the attempt has failed. | ||
|
||
If this was you, check if you signed up using a different address. | ||
|
||
If this was not you, please ignore this email. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Hi, | ||
|
||
you (or someone else) entered this email address when trying to recover access to an account. | ||
|
||
However, this email address is not on our database of registered users and therefore the attempt has failed. | ||
|
||
If this was you, check if you signed up using a different address. | ||
|
||
If this was not you, please ignore this email. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Account access attempted |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Hi, | ||
|
||
please recover access to your account by clicking the following link: | ||
|
||
<a href="{{ .RecoveryURL }}">{{ .RecoveryURL }}</a> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Hi, | ||
|
||
please recover access to your account by clicking the following link: | ||
|
||
{{ .RecoveryURL }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Recover access to your account |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Hi, | ||
|
||
you (or someone else) entered this email address when trying to recover access to an account. | ||
|
||
However, this email address is not on our database of registered users and therefore the attempt has failed. | ||
|
||
If this was you, check if you signed up using a different address. | ||
|
||
If this was not you, please ignore this email. |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,9 @@ | ||||||
Hi, | ||||||
|
||||||
you (or someone else) entered this email address when trying to recover access to an account. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it would make it less ambiguous for now what these emails are referring to if we refer to a "HASH account" rather than just "account". (this suggestion applies to most templates)
Suggested change
cc @nonparibus for thoughts on the initial phrasing here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed "HASH account" preferable. I would like to do a big pass at all of our transactional email copy soon. Not necessarily as part of this PR, but could we consider how we might centrally collect all of our transactional email text in one place? This could be creating an index pointing to the relevant lines of files like this, it could be a single directory that contains the actual emails themselves, or something like else (better) entirely. Either way we're not well set up for this at the moment. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nonparibus for now all the kratos transactional emails are in this folder https://github.com/hashintel/hash/tree/e98a86be821317929dfaa15edfd255af51222726/packages/hash/external-services/kratos/templates There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just want to flag that this suggestion also applies to the remaining email templates (including email subjects). Let me know if you intend on addressing this @thehabbos007 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, missed that this was for all: f710e62 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks -- wasn't aware we had the dir already. This is great. I don't know what ultimate best-practice looks like here, but I would be happy with either:
My sense is the latter probably makes marginally more sense, and will be easier to track. I'll review/update Kratos email copy in a separate PR. Please make any adjustments between the two of you that you think make sense in the meantime. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree that a single directory would make most sense, it may be difficult to do currently without knowing how we structure mails in the HASH api. I'll make an index that links to the email templates in-use from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||
|
||||||
However, this email address is not on our database of registered users and therefore the attempt has failed. | ||||||
|
||||||
If this was you, check if you signed up using a different address. | ||||||
|
||||||
If this was not you, please ignore this email. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Account access attempted |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Hi, | ||
|
||
please recover access to your account by entering the following code: | ||
|
||
{{ .RecoveryCode }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Hi, | ||
|
||
please recover access to your account by entering the following code: | ||
|
||
{{ .RecoveryCode }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Recover access to your account |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Hi, | ||
|
||
someone asked to verify this email address, but we were unable to find an account for this address. | ||
|
||
If this was you, check if you signed up using a different address. | ||
|
||
If this was not you, please ignore this email. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Hi, | ||
|
||
someone asked to verify this email address, but we were unable to find an account for this address. | ||
|
||
If this was you, check if you signed up using a different address. | ||
|
||
If this was not you, please ignore this email. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Someone tried to verify this email address |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Hi, | ||
|
||
please verify your account by entering the following code:<br /> | ||
{{ .VerificationCode }}<br /> | ||
or clicking the following link:<br /> | ||
<a href="{{ .VerificationURL }}" target="_blank">{{ .VerificationURL }}</a><br /> | ||
|
||
The link is valid for 48 hours. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Hi, | ||
|
||
please verify your account by entering the following code: | ||
|
||
{{ .VerificationCode }} | ||
|
||
or clicking the following link: | ||
|
||
{{ .VerificationURL }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Please verify your email address |
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.
Nice, should we make an effort from here on to start copying in the documentation from the ory kratos website?
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.
I think it's very helpful for values that we know we will inject new values into such as this and the
UI_URL
s. Fortunately their env naming matches the path of theyaml
but in upper case and with underscores. I think it's helpful to have the env var to be easily-copied, though