Skip to content

Commit

Permalink
Feat: Attempt to make a base controller manual that everycontroller w…
Browse files Browse the repository at this point in the history
…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.
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;
}
}

0 comments on commit 8315fcf

Please sign in to comment.