-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Attempt to make a base controller manual that everycontroller w…
…ill expand
- Loading branch information
AdrianBalunan
committed
Apr 15, 2026
1 parent
68bbbd0
commit 8315fcf
Showing
1 changed file
with
17 additions
and
0 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
...cation/src/main/java/ntnu/systemutvikling/team6/controller/components/BaseController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| package ntnu.systemutvikling.team6.controller.components; | ||
|
|
||
| import ntnu.systemutvikling.team6.service.AuthenticationService; | ||
|
|
||
| public abstract class BaseController { | ||
| protected AuthenticationService authToken; | ||
|
|
||
| public void setAuthToken(AuthenticationService authToken){ | ||
| this.authToken = authToken; | ||
| authTokenisSet(); | ||
| }; | ||
| protected void authTokenisSet(){} // Do stuff after authtoken is set, on each controller | ||
|
|
||
| protected boolean isLoggedin(){ | ||
| return authToken.isLoggedin() && authToken != null; | ||
| } | ||
| } |