Skip to content

Commit

Permalink
fix: create new instance of SDK client with access to public APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
psanders committed Dec 7, 2023
1 parent 85ec550 commit 031f0d0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions mods/frontoffice/src/containers/AccepInviteContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as SDK from "@goodtok/sdk";
import { API_ENDPOINT } from "~envs";
import { useLocation } from "react-router-dom";
import { useAuth } from "~authentication";
import { useLogger } from "~logger";
import React, { useEffect } from "react";

Expand All @@ -26,14 +27,16 @@ function useQuery() {
}

function AcceptInviteContainer() {
const { client } = useAuth();
const logger = useLogger();
const query = useQuery();
const token = query.get("token") as string;

useEffect(() => {
const client = new SDK.Client({
endpoint: API_ENDPOINT
});
client
?.acceptInvite(token)
.acceptInvite(token)
.then(() => {
window.location.href = "/login";
})
Expand Down

0 comments on commit 031f0d0

Please sign in to comment.