001 package railo.runtime.functions.csrf; 002 003 import railo.runtime.PageContext; 004 import railo.runtime.exp.PageException; 005 import railo.runtime.ext.function.Function; 006 007 public class CSRFVerifyToken implements Function { 008 009 private static final long serialVersionUID = 4173843576558490732L; 010 011 public static boolean call(PageContext pc, String token) throws PageException { 012 return call(pc, token, null); 013 } 014 public static boolean call(PageContext pc, String token, String key) throws PageException { 015 if(key==null) key=""; 016 017 return CSRFGenerateToken.getStorageScope(pc).verifyToken(token, key); 018 } 019 }