You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
828 B
29 lines
828 B
package com.community.pocket.data;
|
|
|
|
import com.community.pocket.data.model.LoggedInUser;
|
|
|
|
import java.io.IOException;
|
|
|
|
/**
|
|
* Class that handles authentication w/ login credentials and retrieves user information.
|
|
*/
|
|
public class LoginDataSource {
|
|
|
|
public Result<LoggedInUser> login(String username, String password) {
|
|
|
|
try {
|
|
// TODO: handle loggedInUser authentication
|
|
LoggedInUser fakeUser =
|
|
new LoggedInUser(
|
|
java.util.UUID.randomUUID().toString(),
|
|
"Jane Doe");
|
|
return new Result.Success<>(fakeUser);
|
|
} catch (Exception e) {
|
|
return new Result.Error(new IOException("Error logging in", e));
|
|
}
|
|
}
|
|
|
|
public void logout() {
|
|
// TODO: revoke authentication
|
|
}
|
|
}
|
|
|