All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jetdrone.vertx.yoke.middleware.GJWT Maven / Gradle / Ivy

There is a newer version: 3.0.0
Show newest version
package com.jetdrone.vertx.yoke.middleware;

import groovy.lang.Closure;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.vertx.java.core.Handler;
import org.vertx.java.core.json.JsonObject;

public class GJWT extends JWT {
    public GJWT() {
        super();
    }

    public GJWT(final @NotNull String skip) {
        super(skip);
    }

    public GJWT(final @NotNull String skip, final @NotNull Closure closure) {
        super(skip, new JWTHandler() {
            @Override
            public void handle(JsonObject token, Handler result) {
                closure.call(token.toMap(), result);
            }
        });
    }

    public GJWT(final @NotNull Closure closure) {
        super(new JWTHandler() {
            @Override
            public void handle(JsonObject token, Handler result) {
                closure.call(token.toMap(), result);
            }
        });
    }
}