Skip to content

Commit

Permalink
changes path for email exists API as per supertokens/frontend-driver-…
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabhpoddar committed Nov 27, 2020
1 parent e742a4a commit 97ef659
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion lib/build/recipe/emailpassword/constants.d.ts
Expand Up @@ -5,4 +5,4 @@ export declare const SIGN_IN_API = "/signin";
export declare const GENERATE_PASSWORD_RESET_TOKEN_API = "/user/password/reset/token";
export declare const PASSWORD_RESET_API = "/user/password/reset";
export declare const SIGN_OUT_API = "/signout";
export declare const EMAIL_EXISTS_API = "/email/exists";
export declare const SIGNUP_EMAIL_EXISTS_API = "/signup/email/exists";
2 changes: 1 addition & 1 deletion lib/build/recipe/emailpassword/constants.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/build/recipe/emailpassword/recipe.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/ts/recipe/emailpassword/constants.ts
Expand Up @@ -27,4 +27,4 @@ export const PASSWORD_RESET_API = "/user/password/reset";

export const SIGN_OUT_API = "/signout";

export const EMAIL_EXISTS_API = "/email/exists";
export const SIGNUP_EMAIL_EXISTS_API = "/signup/email/exists";
6 changes: 3 additions & 3 deletions lib/ts/recipe/emailpassword/recipe.ts
Expand Up @@ -26,7 +26,7 @@ import {
GENERATE_PASSWORD_RESET_TOKEN_API,
PASSWORD_RESET_API,
SIGN_OUT_API,
EMAIL_EXISTS_API,
SIGNUP_EMAIL_EXISTS_API,
} from "./constants";
import {
signUp as signUpAPIToCore,
Expand Down Expand Up @@ -136,8 +136,8 @@ export default class Recipe extends RecipeModule {
},
{
method: "get",
pathWithoutApiBasePath: new NormalisedURLPath(this.getRecipeId(), EMAIL_EXISTS_API),
id: EMAIL_EXISTS_API,
pathWithoutApiBasePath: new NormalisedURLPath(this.getRecipeId(), SIGNUP_EMAIL_EXISTS_API),
id: SIGNUP_EMAIL_EXISTS_API,
disabled: this.config.signUpFeature.disableDefaultImplementation,
},
];
Expand Down
12 changes: 6 additions & 6 deletions test/emailpassword/emailExists.test.js
Expand Up @@ -80,7 +80,7 @@ describe(`emailExists: ${printPath("[test/emailpassword/emailExists.test.js]")}`

let response = await new Promise((resolve) =>
request(app)
.get("/auth/email/exists")
.get("/auth/signup/email/exists")
.query({
email: "random@gmail.com",
})
Expand Down Expand Up @@ -122,7 +122,7 @@ describe(`emailExists: ${printPath("[test/emailpassword/emailExists.test.js]")}`

let response = await new Promise((resolve) =>
request(app)
.get("/auth/email/exists")
.get("/auth/signup/email/exists")
.query({
email: "random@gmail.com",
})
Expand Down Expand Up @@ -168,7 +168,7 @@ describe(`emailExists: ${printPath("[test/emailpassword/emailExists.test.js]")}`

let response = await new Promise((resolve) =>
request(app)
.get("/auth/email/exists")
.get("/auth/signup/email/exists")
.query({
email: "randomgmail.com",
})
Expand Down Expand Up @@ -214,7 +214,7 @@ describe(`emailExists: ${printPath("[test/emailpassword/emailExists.test.js]")}`

let response = await new Promise((resolve) =>
request(app)
.get("/auth/email/exists")
.get("/auth/signup/email/exists")
.query({
email: "RaNdOm@gmail.com",
})
Expand Down Expand Up @@ -256,7 +256,7 @@ describe(`emailExists: ${printPath("[test/emailpassword/emailExists.test.js]")}`

let response = await new Promise((resolve) =>
request(app)
.get("/auth/email/exists")
.get("/auth/signup/email/exists")
.query()
.expect(400)
.end((err, res) => {
Expand Down Expand Up @@ -297,7 +297,7 @@ describe(`emailExists: ${printPath("[test/emailpassword/emailExists.test.js]")}`

let response = await new Promise((resolve) =>
request(app)
.get("/auth/email/exists")
.get("/auth/signup/email/exists")
.query({
email: ["test1", "test2"],
})
Expand Down

0 comments on commit 97ef659

Please sign in to comment.