authenticate("admin") {
get {
val user = call.principal<UserIdPrincipal>()!!
call.respondText { user.name }
}
}
authenticate("users") {
get {
val user = call.principal<UserIdPrincipal>()!!
call.respondText { user.name }
}
}
I need to put both providers into one
authenticate
builder...
Copy code
authenticate("admin", "users") {
get {
val user = call.principal<UserIdPrincipal>()!!
call.respondText { user.name }
}
}
r
Rustam Siniukov
03/16/2022, 3:16 PM
yes, that’s true. in the first example there are different subroutes that doesn’t merge
Rustam Siniukov
03/16/2022, 3:17 PM
I was very surprised with your message, because we have a test for multiple auth providers
h
hfhbd
03/16/2022, 3:18 PM
Hm, okay, so I have to check the role/users permissions 😄
With the first example, I could simple call a different action, because I know, the user is an admin.
hfhbd
03/16/2022, 3:33 PM
So what about adding a check/warning when two routes are equal (except auth), but could not be merged?