MCPcopy
hub / github.com/devias-io/material-kit-react / signInWithPassword

Method signInWithPassword

src/lib/auth/client.ts:54–68  ·  view source on GitHub ↗
(params: SignInWithPasswordParams)

Source from the content-addressed store, hash-verified

52 }
53
54 async signInWithPassword(params: SignInWithPasswordParams): Promise<{ error?: string }> {
55 const { email, password } = params;
56
57 // Make API request
58
59 // We do not handle the API, so we'll check if the credentials match with the hardcoded ones.
60 if (email !== 'sofia@devias.io' || password !== 'Secret1') {
61 return { error: 'Invalid credentials' };
62 }
63
64 const token = generateToken();
65 localStorage.setItem('custom-auth-token', token);
66
67 return {};
68 }
69
70 async resetPassword(_: ResetPasswordParams): Promise<{ error?: string }> {
71 return { error: 'Password reset not implemented' };

Callers 1

SignInFormFunction · 0.80

Calls 1

generateTokenFunction · 0.85

Tested by

no test coverage detected