(params: SignInWithPasswordParams)
| 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' }; |
no test coverage detected