Skip to content

Commit

Permalink
Encoded mail in magic link in url format
Browse files Browse the repository at this point in the history
  • Loading branch information
jot2re authored and Weiwu Zhang committed Aug 26, 2021
1 parent 6a6781c commit 61c1492
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/org/devcon/ticket/Issuer.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.devcon.ticket;

import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import org.tokenscript.attestation.core.AttestationCrypto;
import org.tokenscript.attestation.core.DERUtility;
import org.bouncycastle.asn1.ASN1InputStream;
Expand Down Expand Up @@ -58,7 +60,7 @@ public static void main(String... args) {
String ticketInUrl = new String(
Base64.getUrlEncoder().encode(ticket.getDerEncoding()));
System.out.printf("?ticket=%s&secret=%s&mail=%s", ticketInUrl,
sharedSecret.toString(), mail);
sharedSecret.toString(), URLEncoder.encode(mail, StandardCharsets.UTF_8));
} catch (Exception e) {
System.err.println("Something went wrong. Please check the supplied arguments again and ensure that the private key is an elliptic curve key in RFC 5915 format.");
throw new RuntimeException("Could not produce magic link", e);
Expand Down

0 comments on commit 61c1492

Please sign in to comment.