Skip to content

Commit

Permalink
Type createAuthenticityToken (#109)
Browse files Browse the repository at this point in the history
Before change it returned any
  • Loading branch information
arjunyel committed Nov 14, 2022
1 parent 4fe3e47 commit 3d15e6f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/server/csrf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { unprocessableEntity } from "./responses";
* let token = createAuthenticityToken(session, "csrfToken");
* return json({ ...otherData, csrf: token }); // return the token in the data
*/
export function createAuthenticityToken(session: Session, sessionKey = "csrf") {
export function createAuthenticityToken(session: Session, sessionKey = "csrf"): string {
let token = session.get(sessionKey);
if (token) return token;
token = uuid();
Expand Down

0 comments on commit 3d15e6f

Please sign in to comment.