made saved user auth remember original class if it gets re-used

pull/819/merge
Justin Richer 2015-05-22 16:11:50 -04:00
parent a7905c9f82
commit 84167396da
1 changed files with 7 additions and 1 deletions

View File

@ -67,8 +67,14 @@ public class SavedUserAuthentication implements Authentication {
setName(src.getName());
setAuthorities(src.getAuthorities());
setAuthenticated(src.isAuthenticated());
if (src instanceof SavedUserAuthentication) {
// if we're copying in a saved auth, carry over the original class name
setSourceClass(((SavedUserAuthentication) src).getSourceClass());
} else {
setSourceClass(src.getClass().getName());
}
}
/**
* Create an empty saved auth