I have successfully generated a token and send it to the logged-in client with true credentials. here is how I generate my token.
func createToken(userID uint