add: reset password and basic auth mock service
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
const BASE_URL = process.env.NEXT_PUBLIC_API_URL || 'https://api.example.com'
|
||||
|
||||
export async function checkUserExists(phoneNumber: string): Promise<boolean> {
|
||||
const res = phoneNumber === "123";
|
||||
const data = { status: 200, result: { exists: res } }
|
||||
return data.result.exists
|
||||
}
|
||||
|
||||
export async function signup(userData: {
|
||||
phoneNumber: string,
|
||||
password: string
|
||||
}) {
|
||||
const res = userData.phoneNumber === "123" && userData.password === "123";
|
||||
const data = { sucess: res }
|
||||
return {
|
||||
data,
|
||||
user: {
|
||||
id: '123',
|
||||
name: 'John Doe',
|
||||
number: userData.phoneNumber,
|
||||
token: 'mock-jwt-token',
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export async function login(credentials: {
|
||||
phoneNumber: string,
|
||||
password: string
|
||||
}) {
|
||||
const res = credentials.phoneNumber === "1234" && credentials.password === "1234";
|
||||
const data = { sucess: res }
|
||||
return {
|
||||
data,
|
||||
user: {
|
||||
id: '1234',
|
||||
name: 'Foo bar',
|
||||
number: credentials.phoneNumber,
|
||||
token: 'mock-jwt-token',
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user