Skip to content
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

test(signout): fix skipped test #4484

Merged
merged 2 commits into from Apr 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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