Skip to content

Commit

Permalink
Fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-v committed May 13, 2020
1 parent 471b9c6 commit 10a1393
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.scalecube.services.sut.security;

import io.scalecube.services.auth.Authenticator;
import io.scalecube.services.exceptions.ForbiddenException;
import reactor.core.publisher.Mono;

Expand All @@ -12,7 +13,8 @@ public Mono<String> helloWithRequest(String name) {

@Override
public Mono<String> helloWithPrincipal() {
return Mono.deferWithContext(context -> Mono.just(context.get(UserProfile.class)))
return Mono.deferWithContext(context -> Mono.just(context.get(Authenticator.AUTH_CONTEXT_KEY)))
.cast(UserProfile.class)
.flatMap(
user -> {
checkPrincipal(user);
Expand All @@ -22,7 +24,8 @@ public Mono<String> helloWithPrincipal() {

@Override
public Mono<String> helloWithRequestAndPrincipal(String name) {
return Mono.deferWithContext(context -> Mono.just(context.get(UserProfile.class)))
return Mono.deferWithContext(context -> Mono.just(context.get(Authenticator.AUTH_CONTEXT_KEY)))
.cast(UserProfile.class)
.flatMap(
user -> {
checkPrincipal(user);
Expand Down

0 comments on commit 10a1393

Please sign in to comment.