Skip to content

Commit

Permalink
test(signout): fix skipped test (#4484)
Browse files Browse the repository at this point in the history
  • Loading branch information
ubbe-xyz committed Apr 28, 2022
1 parent 268c063 commit 0b953bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/next-auth/src/client/__tests__/sign-out.test.js
Expand Up @@ -61,11 +61,11 @@ test("it redirects to the URL allowed by the server", async () => {
})
})

test.skip("if url contains a hash during redirection a page reload happens", async () => {
test("if url contains a hash during redirection a page reload happens", async () => {
const mockUrlWithHash = "https://path/to/email/url#foo-bar-baz"

server.use(
rest.post("http://localhost/api/auth/signout", (req, res, ctx) => {
rest.post("*/api/auth/signout", (req, res, ctx) => {
return res(
ctx.status(200),
ctx.json({
Expand Down
1 change: 1 addition & 0 deletions packages/next-auth/src/react/index.tsx
Expand Up @@ -271,6 +271,7 @@ export async function signOut<R extends boolean = true>(
}
const res = await fetch(`${baseUrl}/signout`, fetchOptions)
const data = await res.json()

broadcast.post({ event: "session", data: { trigger: "signout" } })

if (options?.redirect ?? true) {
Expand Down

0 comments on commit 0b953bd

Please sign in to comment.