Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 48 additions & 36 deletions server/src/main/resources/templates/invitation_en.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<title>{{title}}</title>
</head>
<body>
<div class="main" style="width:617px;margin: 0 auto;display:flex;flex-direction:column; padding:24px 32px;font-family:Helvetica, Arial, sans-serif;line-height: 150%;font-size: 18px;color: #000;">
<div class="main" style="width:617px;margin: 0 auto;padding:24px 32px;font-family:Helvetica, Arial, sans-serif;line-height: 150%;font-size: 18px;color: #000;">
<div class="header">
{{#institutionLogoUrl}}
<img src="{{institutionLogoUrl}}" alt="logo" style="height: 48px;width: 48px;"/>
<img src="{{institutionLogoUrl}}" alt="logo" style="height: 48px;width: 48px;"/>
{{/institutionLogoUrl}}
{{#isInstitutionSurf}}
<img src="https://static.surfconext.nl/logos/org/8017e83f-bca7-e911-90f2-0050569571ea.png" alt="logo" style="height: 48px;width: 48px;"/>
<img src="https://static.surfconext.nl/logos/org/8017e83f-bca7-e911-90f2-0050569571ea.png" alt="logo" style="height: 48px;width: 48px;"/>
{{/isInstitutionSurf}}
</div>
<div class="head">
Expand Down Expand Up @@ -41,47 +41,59 @@
</div>
{{/message}}
{{#useEduID}}
<p>You accept the role(s) by logging in with eduID. If you don’t have one yet, you can create it right away.</p>
<div style="display: flex;">
<a class="button" href="{{{ url }}}"
style="border-radius: 4px;color: white;display: flex;background-color: #0077c8;text-decoration: none;cursor:pointer;padding: 8px 20px 8px 10px;">
{{> eduID-logo-square.svg}}
<span style="color: white;margin: auto 0 auto 12px;">Continue with eduID</span>
</a>
</div>
<p>You accept the role(s) by logging in with eduID. If you don't have one yet, you can create it right away.</p>
<table style="border-collapse: collapse; margin: 10px 0;">
<tr>
<td style="border-radius: 4px; background-color: #0077c8; padding: 0; line-height: 0;">
<a class="button" href="{{{ url }}}" style="border-radius: 4px;color: white;text-decoration: none;display: inline-block;padding: 8px 20px 8px 10px">
<table style="border-collapse: collapse;">
<tr>
<td style="vertical-align: middle; padding: 0;">
{{> eduID-logo-square.svg}}
</td>
<td style="vertical-align: middle; padding-left: 12px;">
<span style="color: white;">Continue with eduID</span>
</td>
</tr>
</table>
</a>
</td>
</tr>
</table>
<p style="word-break: break-word">or copy this link into your browser: {{{ url }}}</p>
{{/useEduID}}
{{^useEduID}}
<p>You accept the role(s) by logging in with SURFconext.</p>
<div style="display: flex;">
<a class="button" href="{{{ url }}}"
style="border-radius: 4px;color: white;display: flex;background-color: #0077c8;text-decoration: none;cursor:pointer;padding: 8px 20px 8px 10px;">
<span style="color: white;margin: auto;">Continue</span>
</a>
</div>
<table style="border-collapse: collapse; margin: 10px 0;">
<tr>
<td style="border-radius: 4px; background-color: #0077c8; padding: 0;">
<a class="button" href="{{{ url }}}" style="border-radius: 4px;color: white;text-decoration: none;display: inline-block;padding: 8px 20px;">
<span style="color: white;">Continue</span>
</a>
</td>
</tr>
</table>
<p style="word-break: break-word">or copy this link into your browser: {{{ url }}}</p>
{{/useEduID}}
</div>
<div class="footer"
style="display:flex;align-items:center;justify-content:space-between;padding: 12px 0;line-height: 24px; color: #5E6873; border-top: 1px solid #888F99;font-size: 14px;">
<div class="links" style="text-align: left">
<span>This invitation is sent via</span>
<a class="external" href="https://support.surfconext.nl/invite"
style="color: #636363;">SURFconext Invite</a>
<span> • </span>
<a class="external" href="https://support.surfconext.nl/privacy"
style="color: #636363;">Privacy Policy</a>
<span> • </span>
<a class="external" href="https://support.surfconext.nl/terms-en"
style="color: #636363;">Terms of Use</a>
</div>
<div class="about" style="text-align: right">
<a class="external"
href="https://surf.nl/"
>{{> logo-surf-black.svg}}</a>
</div>
<div class="footer" style="padding: 12px 0;line-height: 24px; color: #5E6873; border-top: 1px solid #888F99;font-size: 14px;">
<table style="width: 100%; border-collapse: collapse;">
<tr>
<td style="text-align: left; vertical-align: middle; padding-right: 10px; line-height: 0;">
<span>This invitation is sent via</span>
<a class="external" href="https://support.surfconext.nl/invite" style="color: #636363; text-decoration: underline;">SURFconext Invite</a>
<span> • </span>
<a class="external" href="https://support.surfconext.nl/privacy" style="color: #636363; text-decoration: underline;">Privacy Policy</a>
<span> • </span>
<a class="external" href="https://support.surfconext.nl/terms-en" style="color: #636363; text-decoration: underline;">Terms of Use</a>
</td>
<td style="text-align: right; vertical-align: middle; white-space: nowrap; width: 100px; line-height: 0;">
<a class="external" href="https://surf.nl/">{{> logo-surf-black.svg}}</a>
</td>
</tr>
</table>
</div>
</div>

</body>
</html>
</html>
83 changes: 48 additions & 35 deletions server/src/main/resources/templates/invitation_nl.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
<title>{{title}}</title>
</head>
<body>
<div class="main" style="width:617px;margin: 0 auto;display:flex;flex-direction:column; padding:24px 32px;font-family:Helvetica, Arial, sans-serif;line-height: 150%;font-size: 18px;color: #000;">
<div class="main" style="width:617px;margin: 0 auto;padding:24px 32px;font-family:Helvetica, Arial, sans-serif;line-height: 150%;font-size: 18px;color: #000;">
<div class="main" style="width:617px;margin: 0 auto;padding:24px 32px;font-family:Helvetica, Arial, sans-serif;line-height: 150%;font-size: 18px;color: #000;">
<div class="header">
{{#institutionLogoUrl}}
<img src="{{institutionLogoUrl}}" alt="logo" style="height: 48px;width: 48px;"/>
<img src="{{institutionLogoUrl}}" alt="logo" style="height: 48px;width: 48px;"/>
{{/institutionLogoUrl}}
{{#isInstitutionSurf}}
<img src="https://static.surfconext.nl/logos/org/8017e83f-bca7-e911-90f2-0050569571ea.png" alt="logo" style="height: 48px;width: 48px;"/>
<img src="https://static.surfconext.nl/logos/org/8017e83f-bca7-e911-90f2-0050569571ea.png" alt="logo" style="height: 48px;width: 48px;"/>
{{/isInstitutionSurf}}
</div>
<div class="head">
Expand Down Expand Up @@ -42,46 +43,58 @@
{{/message}}
{{#useEduID}}
<p>De rol(len) accepteer je door in te loggen met eduID. Als je deze nog niet hebt, kun je hem gelijk aanmaken.</p>
<div style="display: flex;">
<a class="button" href="{{{ url }}}"
style="border-radius: 4px;color: white;display: flex;background-color: #0077c8;text-decoration: none;cursor:pointer;padding: 8px 20px 8px 10px;">
{{> eduID-logo-square.svg}}
<span style="color: white;margin: auto 0 auto 12px;">Ga door met eduID</span>
</a>
</div>
<table style="border-collapse: collapse; margin: 10px 0;">
<tr>
<td style="border-radius: 4px; background-color: #0077c8; padding: 0; line-height: 0;">
<a class="button" href="{{{ url }}}" style="border-radius: 4px;color: white;text-decoration: none;display: inline-block;padding: 8px 20px 8px 10px">
<table style="border-collapse: collapse;">
<tr>
<td style="vertical-align: middle; padding: 0;">
{{> eduID-logo-square.svg}}
</td>
<td style="vertical-align: middle; padding-left: 12px;">
<span style="color: white;">Ga door met eduID</span>
</td>
</tr>
</table>
</a>
</td>
</tr>
</table>
<p style="word-break: break-word">of kopieer deze link in je browser: {{{ url }}}</p>
{{/useEduID}}
{{^useEduID}}
<p>De rol(len) accepteer je door in te loggen met SURFconext.</p>
<div style="display: flex;">
<a class="button" href="{{{ url }}}"
style="border-radius: 4px;color: white;display: flex;background-color: #0077c8;text-decoration: none;cursor:pointer;padding: 8px 20px 8px 10px;">
<span style="color: white;margin: auto;">Ga door</span>
</a>
</div>
<table style="border-collapse: collapse; margin: 10px 0;">
<tr>
<td style="border-radius: 4px; background-color: #0077c8; padding: 0;">
<a class="button" href="{{{ url }}}" style="border-radius: 4px;color: white;text-decoration: none;display: inline-block;padding: 8px 20px;">
<span style="color: white;">Ga door</span>
</a>
</td>
</tr>
</table>
<p style="word-break: break-word">of kopieer deze link in je browser: {{{ url }}}</p>
{{/useEduID}}
</div>
<div class="footer"
style="display:flex;align-items:center;justify-content:space-between;padding: 12px 0;line-height: 24px; color: #5E6873; border-top: 1px solid #888F99;font-size: 14px;">
<div class="links" style="text-align: left">
<span>Deze uitnoding verloopt via</span>
<a class="external" href="https://support.surfconext.nl/invite"
style="color: #636363;">SURFconext Invite</a>
<span> • </span>
<a class="external" href="https://support.surfconext.nl/privacy-nl"
style="color: #636363;">Privacy Policy</a>
<span> • </span>
<a class="external" href="https://support.surfconext.nl/terms-nl"
style="color: #636363;">Voorwaarden</a>
</div>
<div class="about" style="text-align: right">
<a class="external"
href="https://surf.nl/"
>{{> logo-surf-black.svg}}</a>
</div>
<div class="footer" style="padding: 12px 0;line-height: 24px; color: #5E6873; border-top: 1px solid #888F99;font-size: 14px;">
<table style="width: 100%; border-collapse: collapse;">
<tr>
<td style="text-align: left; vertical-align: middle; padding-right: 10px; line-height: 0;">
<span>Deze uitnoding verloopt via</span>
<a class="external" href="https://support.surfconext.nl/invite" style="color: #636363; text-decoration: underline;">SURFconext Invite</a>
<span> • </span>
<a class="external" href="https://support.surfconext.nl/privacy-nl" style="color: #636363; text-decoration: underline;">Privacy Policy</a>
<span> • </span>
<a class="external" href="https://support.surfconext.nl/terms-nl" style="color: #636363; text-decoration: underline;">Voorwaarden</a>
</td>
<td style="text-align: right; vertical-align: middle; white-space: nowrap; width: 100px; line-height: 0;">
<a class="external" href="https://surf.nl/">{{> logo-surf-black.svg}}</a>
</td>
</tr>
</table>
</div>
</div>

</body>
</html>
</html>
23 changes: 23 additions & 0 deletions server/src/test/java/invite/api/InvitationControllerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,29 @@ void resendInviteMailExpirationDate() throws Exception {
assertTrue(savedInvitation.getExpiryDate().isAfter(Instant.now().plus(13, ChronoUnit.DAYS)));
}

@Test
void resendInviteMailExpirationDateNL() throws Exception {
AccessCookieFilter accessCookieFilter = openIDConnectFlow("/api/v1/users/login", INVITER_SUB);
Invitation invitation = invitationRepository.findByHash(Authority.GUEST.name()).get();
invitation.setExpiryDate(Instant.now().minus(5, ChronoUnit.DAYS));
invitation.setLanguage(Language.nl);
invitationRepository.save(invitation);

super.stubForManageProviderById(EntityType.OIDC10_RP, "5");
given()
.when()
.filter(accessCookieFilter.cookieFilter())
.accept(ContentType.JSON)
.header(accessCookieFilter.csrfToken().getHeaderName(), accessCookieFilter.csrfToken().getToken())
.contentType(ContentType.JSON)
.pathParam("id", invitation.getId())
.put("/api/v1/invitations/{id}")
.then()
.statusCode(201);
Invitation savedInvitation = invitationRepository.findByHash(Authority.GUEST.name()).get();
assertTrue(savedInvitation.getExpiryDate().isAfter(Instant.now().plus(13, ChronoUnit.DAYS)));
}

@Test
void invitationsSearchSuperUser() throws Exception {
AccessCookieFilter accessCookieFilter = openIDConnectFlow("/api/v1/users/login", SUPER_SUB);
Expand Down
Loading