Skip to content

Commit

Permalink
feat(Collaboration): Authentication: pass authentication token to the…
Browse files Browse the repository at this point in the history
… collaboration server.
  • Loading branch information
thet committed Feb 3, 2022
1 parent dd4b4fc commit 9e09aba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ <h2>TipTap basic example</h2>
context-menu-tags: #context-menu-tags;
url-scheme-tags: https://quaive.cornelis.amsterdam/tags/{TAG};
collaboration-server: ws://127.0.0.1:1234;
collaboration-document: example-document
collaboration-document: example-document;
collaboration-authentication-token: testtoken;
"
placeholder="Your poem goes here..."
autocomplete="off"
Expand Down
2 changes: 2 additions & 0 deletions src/tiptap.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ parser.addArgument("context-menu-tags", null);
parser.addArgument("url-scheme-tags", null);

parser.addArgument("collaboration-server", null);
parser.addArgument("collaboration-authentication-token", null);
parser.addArgument("collaboration-document", null);
parser.addArgument("collaboration-user", null);
parser.addArgument("collaboration-color", null);
Expand Down Expand Up @@ -181,6 +182,7 @@ export default Base.extend({
const provider = new HocuspocusProvider({
url: this.options.collaboration.server,
name: this.options.collaboration.document,
token: this.options.collaboration["authentication-token"],
});
provider.setAwarenessField("user", {
name: user_name,
Expand Down

0 comments on commit 9e09aba

Please sign in to comment.