mirror of
https://github.com/wassname/talk.git
synced 2026-08-05 13:30:26 +08:00
Merge branch 'master' into fix-ipad-touch-issue
This commit is contained in:
@@ -81,4 +81,4 @@ TALK_JWT_SECRET=jX9y8G2ApcVLwyL{$6s3
|
||||
|
||||
Be default, we sign our tokens with HMAC using a SHA-256 hash algorithm. If you
|
||||
want to change the signing algorithm, or use multiple signing/verifying keys,
|
||||
refer to our [Advanced Configuration](/talk/advanced-configuration/) documentation.
|
||||
refer to our [Advanced Configuration](/talk/advanced-configuration/#talk-jwt-secret) documentation.
|
||||
|
||||
@@ -25,9 +25,10 @@ state (you don't use the auth anywhere else now). A great example of this is our
|
||||
You can integrate Talk with any authentication service to enable single sign-on
|
||||
for users. The steps to do that are:
|
||||
|
||||
1. Create a service that generates [JWT tokens](https://jwt.io).
|
||||
1. Create a service that generates [JWT tokens](https://jwt.io/introduction/).
|
||||
2. Push the token into the embed.
|
||||
3. Implement the `tokenUserNotFound` hook to process the token.
|
||||
3. Implement the [`tokenUserNotFound`](#implement-tokenusernotfound) hook to
|
||||
process the token.
|
||||
|
||||
### Create JWT Token
|
||||
|
||||
@@ -39,7 +40,20 @@ Using that demo application, you'll see how you can:
|
||||
|
||||
1. Create a node application that can issue JWT's that are compatible with Talk.
|
||||
2. Provide a validation endpoint that can be used by Talk to validate the token
|
||||
and get the user via the `tokenUserNotFound` hook.
|
||||
and get the user via the [`tokenUserNotFound`](#implement-tokenusernotfound)
|
||||
hook.
|
||||
|
||||
It's also important to note a few requirements for proper integration with Talk.
|
||||
The generated JWT must contain the following claims:
|
||||
|
||||
- [`jti`](https://tools.ietf.org/html/rfc7519#section-4.1.7): a unique identifier for the token (like a uuid/v4)
|
||||
- [`exp`](https://tools.ietf.org/html/rfc7519#section-4.1.4): the expiry date of the token as a unix timestamp
|
||||
- [`sub`](https://tools.ietf.org/html/rfc7519#section-4.1.2): the user identifier that can be used to lookup the user in the mongo
|
||||
database
|
||||
- The user may not yet exist in the database, but that's the responsibility
|
||||
of the [`tokenUserNotFound`](#implement-tokenusernotfound) hook.
|
||||
- [`iss`](https://tools.ietf.org/html/rfc7519#section-4.1.1): the issuer for the token must match the value of `TALK_JWT_ISSUER`
|
||||
- [`aud`](https://tools.ietf.org/html/rfc7519#section-4.1.3): the audience for the token must match the value of `TALK_JWT_AUDIENCE`
|
||||
|
||||
### Push token into embed
|
||||
|
||||
@@ -47,7 +61,8 @@ We're assuming that your CMS is capable of authenticating a user account, or
|
||||
at least having the user's details available to send off to the token creation
|
||||
service we created/used in the previous step.
|
||||
|
||||
Using the token that was created for the user, you simply have to ammend the template where Talk is rendering to read as the following:
|
||||
Using the token that was created for the user, you simply have to amend the
|
||||
template where Talk is rendering to read as the following:
|
||||
|
||||
```js
|
||||
Coral.Talk.render(document.getElementById('coralStreamEmbed'), {
|
||||
@@ -72,12 +87,12 @@ example issuer and Talk must match:
|
||||
|
||||
| Talk | Token Issuer Example |
|
||||
|------|----------------------|
|
||||
|`JWT_ISSUER`|`JWT_ISSUER`|
|
||||
|`JWT_AUDIENCE`|`JWT_AUDIENCE`|
|
||||
|`SECRET`|`JWT_SECRET`*|
|
||||
|[`TALK_JWT_ISSUER`](/talk/advanced-configuration/#talk-jwt-issuer)|`JWT_ISSUER`|
|
||||
|[`TALK_JWT_AUDIENCE`](/talk/advanced-configuration/#talk-jwt-audience)|`JWT_AUDIENCE`|
|
||||
|[`TALK_JWT_SECRET`](/talk/advanced-configuration/#talk-jwt-secret)|`JWT_SECRET`*|
|
||||
|
||||
\* Note that secrets is a pretty complex topic, refer to the
|
||||
[TALK-JWT-SECRET](/talk/advanced-configuration/#TALK-JWT-SECRET) configuration
|
||||
[TALK_JWT_SECRET](/talk/advanced-configuration/#talk-jwt-secret) configuration
|
||||
reference, the basic takeaway is that the secret used to sign the tokens issued
|
||||
by the issuer must be able to be verified by Talk.
|
||||
|
||||
|
||||
+2
-3
@@ -291,11 +291,10 @@ pre {
|
||||
|
||||
.content {
|
||||
article {
|
||||
p a:not(.plain-link) {
|
||||
@extend .coral-link;
|
||||
}
|
||||
p a:not(.plain-link),
|
||||
ul:not(.toc__menu) li a,
|
||||
ol li a,
|
||||
td a,
|
||||
dd > a {
|
||||
@extend .coral-link;
|
||||
}
|
||||
|
||||
@@ -227,6 +227,7 @@ en:
|
||||
embedlink:
|
||||
copy: "Copy to Clipboard"
|
||||
error:
|
||||
AUTHENTICATION: "An error occurred trying to authenticate your account."
|
||||
PASSWORD_INCORRECT: "Your current password was entered incorrectly"
|
||||
COMMENT_PARENT_NOT_VISIBLE: "The comment that you're replying to has been removed or doesn't exist."
|
||||
EMAIL_VERIFICATION_TOKEN_INVALID: "Email verification token is invalid."
|
||||
|
||||
@@ -39,6 +39,7 @@ en:
|
||||
confirmation_title: Ignore {0}?
|
||||
de:
|
||||
talk-plugin-ignore-user:
|
||||
blank_info: Sie ignorieren derzeit keine Nutzer
|
||||
section_title: Ignorierte Nutzer
|
||||
section_info: Weil Sie die folgenden Nutzer ignorieren, sind deren Kommentare versteckt.
|
||||
stop_ignoring: Ignorieren beenden
|
||||
|
||||
@@ -185,7 +185,7 @@ class ChangePassword extends React.Component {
|
||||
>
|
||||
<InputField
|
||||
id="oldPassword"
|
||||
label="Old Password"
|
||||
label={t('talk-plugin-local-auth.change_password.old_password')}
|
||||
name="oldPassword"
|
||||
type="password"
|
||||
onChange={this.onChange}
|
||||
@@ -205,7 +205,7 @@ class ChangePassword extends React.Component {
|
||||
</InputField>
|
||||
<InputField
|
||||
id="newPassword"
|
||||
label="New Password"
|
||||
label={t('talk-plugin-local-auth.change_password.new_password')}
|
||||
name="newPassword"
|
||||
type="password"
|
||||
onChange={this.onChange}
|
||||
@@ -216,7 +216,9 @@ class ChangePassword extends React.Component {
|
||||
/>
|
||||
<InputField
|
||||
id="confirmNewPassword"
|
||||
label="Confirm New Password"
|
||||
label={t(
|
||||
'talk-plugin-local-auth.change_password.confirm_new_password'
|
||||
)}
|
||||
name="confirmNewPassword"
|
||||
type="password"
|
||||
onChange={this.onChange}
|
||||
|
||||
@@ -65,7 +65,7 @@ class ChangeUsernameContentDialog extends React.Component {
|
||||
<form onSubmit={this.confirmChanges}>
|
||||
<InputField
|
||||
id="confirmNewUsername"
|
||||
label="Re-enter new username"
|
||||
label={t('talk-plugin-local-auth.change_username.re_enter')}
|
||||
name="confirmNewUsername"
|
||||
type="text"
|
||||
onChange={this.props.onChange}
|
||||
|
||||
@@ -13,6 +13,9 @@ en:
|
||||
passwords_dont_match: "Passwords don`t match"
|
||||
required_field: "This field is required"
|
||||
forgot_password: "Forgot your password?"
|
||||
old_password: "Old Password"
|
||||
new_password: "New Password"
|
||||
confirm_new_password: "Confirm New Password"
|
||||
save: "Save"
|
||||
cancel: "Cancel"
|
||||
edit: "Edit"
|
||||
@@ -28,6 +31,7 @@ en:
|
||||
description: "You are attempting to change your username. Your new username will appear on all of your past and future comments."
|
||||
old_username: "Old Username"
|
||||
new_username: "New Username"
|
||||
re_enter: "Re-enter new username"
|
||||
bottom_note: "Note: You will not be able to change your username again for 14 days"
|
||||
confirm_changes: "Confirm Changes"
|
||||
username_does_not_match: "Username does not match"
|
||||
@@ -84,13 +88,17 @@ de:
|
||||
passwords_dont_match: "Die Passwörter stimmen nicht überein"
|
||||
required_field: "Diese Angabe ist erforderlich"
|
||||
forgot_password: "Passwort vergessen?"
|
||||
old_password: "Altes Passwort"
|
||||
new_password: "Neues Passwort"
|
||||
confirm_new_password: "Neues Passwort bestätigen"
|
||||
save: "Speichern"
|
||||
cancel: "Abbrechen"
|
||||
edit: "Ändern"
|
||||
changed_password_msg: "Passwort geändert - Ihr Passwort wurde erfolgreich geändert"
|
||||
forgot_password_sent: "Passwort vergessen - Wir haben Ihnen eine E-Mail zum Zurücksetzen des Passwortes geschickt"
|
||||
change_username:
|
||||
change_username_note: "Nutzernamen können nur alle 14 Tage geändert werden. Ihr Nutzername ist zur Zeit nicht editierbar."
|
||||
change_username_note: "Nutzernamen können nur alle 14 Tage geändert werden."
|
||||
is_not_eligible: "Sie können Ihren Nutzernamen derzeit nicht ändern."
|
||||
save: "Speichern"
|
||||
edit_profile: "Profil ändern"
|
||||
cancel: "Abbrechen"
|
||||
@@ -98,6 +106,7 @@ de:
|
||||
description: "Sie möchten Ihren Nutzernamen ändern: der neue Nutzername wird an allen alten und neuen Kommentaren erscheinen."
|
||||
old_username: "Alter Nutzername"
|
||||
new_username: "Neuer Nutzername"
|
||||
re_enter: "Neuen Nutzernamen bestätigen"
|
||||
bottom_note: "Achtung: die nächste Änderung des Nutzernamens ist erst nach 14 Tagen möglich"
|
||||
confirm_changes: "Änderung bestätigen"
|
||||
username_does_not_match: "Die Nutzernamen stimmen nicht überein"
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<%= t('email.password_reset.we_received_a_request') %>. <%= t('email.password_reset.if_you_did') %> <%= t('email.password_reset.please_click') %>:
|
||||
<%= t('email.password_reset.we_received_a_request') %> <%= t('email.password_reset.if_you_did') %> <%= t('email.password_reset.please_click') %>:
|
||||
|
||||
<%= BASE_URL %>account/password/reset#<%= token %>
|
||||
|
||||
Reference in New Issue
Block a user