login method

  1. @override
Future<UserDto> login(
  1. String username,
  2. String password
)
override

Authenticates a user with NTUT Portal credentials.

Sets the JSESSIONID cookie in the app.ntut.edu.tw domain for subsequent authenticated requests. This session cookie is shared across all services.

Returns user profile information including name, email, and avatar filename.

Throws LoginException on failure with a LoginFailure indicating the reason (wrong credentials, account locked, password expired, etc.).

Implementation

@override
Future<UserDto> login(String username, String password) async {
  return loginResult ??
      (
        name: '王大同',
        avatarFilename: '111592347_temp1714460935341.jpeg',
        email: 't111592347@ntut.edu.tw',
        passwordExpiresInDays: null,
      );
}