- java.lang.Object
-
- controllers.AuthController
-
public class AuthController extends java.lang.Object
TheAuthController
class provides utility methods for managing user authentication within the CAMS application. It contains method to start and end user sessions, and handle user login and logout. The class utilizes theIAuthService
interface for handling the authentication process.
-
-
Field Summary
Fields Modifier and Type Field Description private static IAuthService
authService
IAuthService
object to authenticate userprivate static java.util.Scanner
sc
Scanner
object to get input from user
-
Constructor Summary
Constructors Modifier Constructor Description private
AuthController()
Private constructor to prevent instantiation as it is not meant to be instantiated.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
changeToCommittee()
Switch logged in user from student to committeestatic void
changeToStudent()
Switch logged in user from committee to studentstatic void
endSession()
Ends the current user session by logging the user outstatic void
startSession()
Starting a session for log in
-
-
-
Field Detail
-
sc
private static final java.util.Scanner sc
Scanner
object to get input from user
-
authService
private static IAuthService authService
IAuthService
object to authenticate user
-
-
Method Detail
-
startSession
public static void startSession()
Starting a session for log in
-
changeToCommittee
public static void changeToCommittee()
Switch logged in user from student to committee
-
changeToStudent
public static void changeToStudent()
Switch logged in user from committee to student
-
endSession
public static void endSession()
Ends the current user session by logging the user out
-
-