• Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
v3.5.2 Latest
Buy Hosting

Cannor ready get() of undefined(csrf.get())

Scheduled Pinned Locked Moved NodeBB Plugins
5 Posts 2 Posters 1.6k Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • DoppyD Offline
    DoppyD Offline
    Doppy GNU/Linux
    wrote on last edited by Doppy
    #1

    When i delete an account I must redirect him to another page create from me and do logout. t I use this to resolve my problem and first it work but now it doesn't work.

    require(['csrf'], function(csrf) {
    										$.ajax(config.relative_path + '/logout', {
    											type: 'POST',
    											headers: {
    												'x-csrf-token': csrf.get()
    											},
    											success: function() {
    								window.location.href = config.relative_path + '/client/pagina-utente-cancellato';
    											}
    										});
    									});
    

    Now when I change versione this method doesn't work anymore. Anyone can explain why?

    1 Reply Last reply
    0
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    wrote on last edited by
    #2

    Use config.csrf_token instead of the requirejs module

    1 Reply Last reply
    0
  • DoppyD Offline
    DoppyD Offline
    Doppy GNU/Linux
    wrote on last edited by
    #3

    @baris can you show me the correct code please? I don't understand how I can modify my code

    1 Reply Last reply
    0
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    wrote on last edited by
    #4
    $.ajax(config.relative_path + '/logout', {
    	type: 'POST',
    	headers: {
    		'x-csrf-token': config.csrf_token
    	},
    	success: function() {
    		window.location.href = config.relative_path + '/client/pagina-utente-cancellato';
    	}
    });
    
    1 Reply Last reply
    1
  • DoppyD Offline
    DoppyD Offline
    Doppy GNU/Linux
    wrote on last edited by Doppy
    #5

    @baris It works thank for your support!

    1 Reply Last reply
    0

Copyright © 2023 NodeBB | Contributors
  • Login

  • Don't have an account? Register

  • Login or register to search.
Powered by NodeBB Contributors
  • First post
    Last post
0
  • Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development