package com.smyhub.store.mengyastorebackendjava.security;

public final class CurrentUserHolder {

    private static final ThreadLocal<SproutGateUser> HOLDER = new ThreadLocal<>();

    private CurrentUserHolder() {}

    public static void set(SproutGateUser user) {
        HOLDER.set(user);
    }

    public static SproutGateUser get() {
        return HOLDER.get();
    }

    public static void clear() {
        HOLDER.remove();
    }
}
