added basic create account
- add link in to creat in users.html - AccountController - add getCreateAccount - add postCreateAccount - add create.html - add AccountForm to Account Request in Mapping.kt - add AccountForm - add addAccount to AccountRegistryService - add accountRegistryCreate to WebClientCalls.kt - add UsernameDuplicateException - add AccountRegistryException - add HlaejaException
This commit is contained in:
@@ -1,10 +1,18 @@
|
||||
package ltd.hlaeja.util
|
||||
|
||||
import org.springframework.security.core.Authentication as SpringAuthentication
|
||||
|
||||
import ltd.hlaeja.form.AccountForm
|
||||
import ltd.hlaeja.library.accountRegistry.Account
|
||||
import ltd.hlaeja.library.accountRegistry.Authentication
|
||||
import org.springframework.security.core.Authentication as SpringAuthentication
|
||||
|
||||
fun SpringAuthentication.toAuthenticationRequest(): Authentication.Request = Authentication.Request(
|
||||
principal as String,
|
||||
credentials as String,
|
||||
)
|
||||
|
||||
fun AccountForm.toAccountRequest(): Account.Request = Account.Request(
|
||||
username = username,
|
||||
password = password,
|
||||
enabled = enabled,
|
||||
roles = listOf("ROLE_${role.uppercase()}"),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user