Skip to content

Commit 32da1d2

Browse files
author
kaleidox
committed
auto create new authenticated users
1 parent 62c0da1 commit 32da1d2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main/java/de/kaleidox/workbench/repo/UserRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ public interface UserRepository extends CrudRepository<User, String> {
1717
default Optional<User> get(Authentication auth) {
1818
if (auth == null) return Debug.isDebug() ? of(save(User.DEV)) : empty();
1919
var username = auth.getName();
20-
return findById(username).or(() -> Debug.isDebug() ? of(save(User.DEV)) : empty());
20+
return findById(username).or(() -> of(save(Debug.isDebug() ? User.DEV : new User(username, username))));
2121
}
2222
}

0 commit comments

Comments
 (0)