diff --git a/src/core/client/framework/rest/index.ts b/src/core/client/framework/rest/index.ts new file mode 100644 index 000000000..0b3032bb5 --- /dev/null +++ b/src/core/client/framework/rest/index.ts @@ -0,0 +1,2 @@ +export { default as signIn, SignInInput } from "./signIn"; +export { default as signUp, SignUpInput } from "./signUp"; diff --git a/src/core/client/framework/rest/signIn.ts b/src/core/client/framework/rest/signIn.ts new file mode 100644 index 000000000..4b537b01c --- /dev/null +++ b/src/core/client/framework/rest/signIn.ts @@ -0,0 +1,13 @@ +import { RestClient } from "../lib/rest"; + +export interface SignInInput { + username: string; + password: string; +} + +export default function signIn(rest: RestClient, input: SignInInput) { + return rest.fetch("/tenant/auth/local", { + method: "POST", + body: input, + }); +} diff --git a/src/core/client/framework/rest/signUp.ts b/src/core/client/framework/rest/signUp.ts new file mode 100644 index 000000000..eece6271b --- /dev/null +++ b/src/core/client/framework/rest/signUp.ts @@ -0,0 +1,14 @@ +import { RestClient } from "../lib/rest"; + +export interface SignUpInput { + username: string; + password: string; + email: string; +} + +export default function signUp(rest: RestClient, input: SignUpInput) { + return rest.fetch("/tenant/auth/local/signup", { + method: "POST", + body: input, + }); +}