Skip to content

Commit

Permalink
chore: redirect to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
astappiev committed Aug 11, 2024
1 parent 3b2b537 commit 6fd2c93
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 78 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package de.l3s.interweb.server.features.user;

import java.net.URI;
import java.util.Optional;

import jakarta.inject.Inject;
Expand Down Expand Up @@ -104,8 +105,8 @@ private Uni<User> findOrCreateUser(String email) {
private Uni<Void> createAndSendToken(User user, UriInfo uriInfo) {
return createToken(user)
.chain(token -> {
log.infof("Login token %s created for user %s", token.token, user.email);
String tokenUrl = uriInfo.getBaseUri() + "jwt?token=" + token.token;
log.infof("Login token for user %s created: %s", user.email, token.token);
URI tokenUrl = uriInfo.getBaseUriBuilder().path("/jwt").queryParam("token", token.token).build();
return mailer.send(Mail.withText(user.email, LOGIN_EMAIL_SUBJECT, LOGIN_EMAIL_BODY.formatted(tokenUrl)));
});
}
Expand Down
78 changes: 3 additions & 75 deletions interweb-server/src/main/resources/META-INF/resources/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion interweb-server/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ quarkus.log.sentry.ignored-exceptions-for-type=jakarta.validation.ValidationExce

# OpenAPI, Swagger
quarkus.swagger-ui.always-include=true
quarkus.swagger-ui.path=/api
quarkus.swagger-ui.path=docs
quarkus.swagger-ui.theme=muted
quarkus.swagger-ui.with-credentials=true
quarkus.swagger-ui.request-interceptor=function(req){var authToken=localStorage.getItem('authorized');if(authToken){var authData=JSON.parse(authToken);if(authData.JWT){req.headers['Authorization']='Bearer '+authData.JWT.value;} else if(authData.ApiKey) {req.headers['Api-Key']=authData.ApiKey.value;}}return req;}
Expand Down

0 comments on commit 6fd2c93

Please sign in to comment.