-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add 2FA type in authentication error message (#19894)
* feat: add 2FA type in authentication error message Signed-off-by: Morten Svanaes <[email protected]>
- Loading branch information
Showing
7 changed files
with
27 additions
and
11 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -27,13 +27,21 @@ | |
*/ | ||
package org.hisp.dhis.security.spring2fa; | ||
|
||
import org.hisp.dhis.security.twofa.TwoFactorType; | ||
import org.springframework.security.authentication.BadCredentialsException; | ||
|
||
/** | ||
* @author Morten Svanæs <[email protected]> | ||
*/ | ||
public class TwoFactorAuthenticationException extends BadCredentialsException { | ||
public TwoFactorAuthenticationException(String msg) { | ||
private final TwoFactorType type; | ||
|
||
public TwoFactorAuthenticationException(String msg, TwoFactorType type) { | ||
super(msg); | ||
this.type = type; | ||
} | ||
|
||
public TwoFactorType getType() { | ||
return type; | ||
} | ||
} |
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
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
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
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
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
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